mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Avoid pointless copies
This commit is contained in:
parent
aad5399240
commit
ebf21f4add
|
@ -350,6 +350,11 @@ impl RegularMap {
|
|||
Tile::default()
|
||||
};
|
||||
|
||||
if old_tile == new_tile {
|
||||
// no need to mark as dirty if nothing changes
|
||||
return;
|
||||
}
|
||||
|
||||
self.tiles[pos] = new_tile;
|
||||
self.tiles_dirty = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue