mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-27 09:36:39 +11:00
Avoid pointless copies
This commit is contained in:
parent
aad5399240
commit
ebf21f4add
1 changed files with 5 additions and 0 deletions
|
@ -350,6 +350,11 @@ impl RegularMap {
|
||||||
Tile::default()
|
Tile::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if old_tile == new_tile {
|
||||||
|
// no need to mark as dirty if nothing changes
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self.tiles[pos] = new_tile;
|
self.tiles[pos] = new_tile;
|
||||||
self.tiles_dirty = true;
|
self.tiles_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue