Skip to content

Commit cab3ea3

Browse files
committed
Avoid compiler warning about dangling reference
This addresses the following warning: warning: possibly dangling reference to a temporary [-Wdangling-reference] 777 | const Chunk &chunk = it.next().value(); | ^~~~~ It's a false positive, since even though the temporary was destroyed, the returned Chunk reference will remain valid...
1 parent 3141a39 commit cab3ea3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libtiled/tilelayer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,8 @@ QVector<QRect> TileLayer::sortedChunksToWrite(QSize chunkSize) const
774774

775775
QHashIterator<QPoint, Chunk> it(mChunks);
776776
while (it.hasNext()) {
777-
const Chunk &chunk = it.next().value();
777+
it.next();
778+
const Chunk &chunk = it.value();
778779
if (chunk.isEmpty())
779780
continue;
780781

0 commit comments

Comments
 (0)