Codechange: Use .fill() to clear an array instead of assigning a new array. (#13880)

Avoids allocating a temporary on the stack.
This commit is contained in:
Peter Nelson
2025-03-23 22:09:45 +00:00
committed by GitHub
parent ca801d55d5
commit fc7b6c6cbb
4 changed files with 5 additions and 5 deletions

View File

@@ -675,8 +675,8 @@ static void UpdateVehicleViewportHash(Vehicle *v, int x, int y, int old_x, int o
void ResetVehicleHash()
{
for (Vehicle *v : Vehicle::Iterate()) { v->hash_tile_current = nullptr; }
_vehicle_viewport_hash = {};
_vehicle_tile_hash = {};
_vehicle_viewport_hash.fill(nullptr);
_vehicle_tile_hash.fill(nullptr);
}
void ResetVehicleColourMap()