Skip to content

Commit dd32ddc

Browse files
committed
Use std::swap instead of std::move to "steal" dirty tiles
This leaves the other->m_dirty_tiles in a defined empty state instead of the somewhat murky "moved-from" state.
1 parent 41ec9ca commit dd32ddc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/expire-tiles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ void expire_tiles::merge_and_destroy(expire_tiles *other)
257257
}
258258

259259
if (m_dirty_tiles.empty()) {
260-
m_dirty_tiles = std::move(other->m_dirty_tiles);
260+
using std::swap;
261+
swap(m_dirty_tiles, other->m_dirty_tiles);
261262
} else {
262263
m_dirty_tiles.insert(other->m_dirty_tiles.begin(),
263264
other->m_dirty_tiles.end());

0 commit comments

Comments
 (0)