Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit()

This commit is contained in:
Henry Wilson
2018-09-21 22:45:44 +01:00
committed by PeterN
parent bfd79e59dc
commit 9cba6f7193
15 changed files with 18 additions and 26 deletions

View File

@@ -103,8 +103,8 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
/* Ensure the lists are not wasting too much space. If the lists are fresh
* (i.e. built within a command) then this will actually do nothing. */
engines->Compact();
if (wagons != NULL && wagons != engines) wagons->Compact();
engines->shrink_to_fit();
if (wagons != NULL && wagons != engines) wagons->shrink_to_fit();
}
/**
@@ -184,6 +184,6 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
default: return false;
}
list->Compact();
list->shrink_to_fit();
return true;
}