🔧 Avoid clone in rebuild_touched_tiles

Use std::mem::take instead of clone to avoid HashSet allocation.
The set was cleared anyway by clean_touched(), so take() is safe.
This commit is contained in:
Elena Torro
2026-02-04 11:01:58 +01:00
parent e5cdb5b163
commit a3764b9713

View File

@@ -2307,7 +2307,7 @@ impl RenderState {
let mut all_tiles = HashSet::<tiles::Tile>::new();
let ids = self.touched_ids.clone();
let ids = std::mem::take(&mut self.touched_ids);
for shape_id in ids.iter() {
if let Some(shape) = tree.get(shape_id) {
@@ -2322,8 +2322,6 @@ impl RenderState {
self.remove_cached_tile(tile);
}
self.clean_touched();
performance::end_measure!("rebuild_touched_tiles");
}