Codechange: Base CargoArray off std::array.

This avoids needing to define array accessors and allows use of
default value initialization.
This commit is contained in:
Peter Nelson
2023-05-23 12:23:50 +01:00
committed by PeterN
parent 74e42e39a8
commit f177ce7c9a
14 changed files with 26 additions and 68 deletions

View File

@@ -1375,7 +1375,7 @@ static bool VehicleProfitLastYearSorter(const Vehicle * const &a, const Vehicle
static bool VehicleCargoSorter(const Vehicle * const &a, const Vehicle * const &b)
{
const Vehicle *v;
CargoArray diff;
CargoArray diff{};
/* Append the cargo of the connected waggons */
for (v = a; v != nullptr; v = v->Next()) diff[v->cargo_type] += v->cargo_cap;