Codechange: Remove min/max functions in favour of STL variants (#8502)

This commit is contained in:
Charles Pigott
2021-01-08 10:16:18 +00:00
committed by GitHub
parent c1fddb9a6a
commit 9b800a96ed
181 changed files with 900 additions and 954 deletions

View File

@@ -115,7 +115,7 @@ void CheckCargoCapacity(Vehicle *v)
assert(dest->cargo.TotalCount() == dest->cargo.ActionCount(VehicleCargoList::MTA_KEEP));
if (dest->cargo.TotalCount() >= dest->cargo_cap || dest->cargo_type != src->cargo_type) continue;
uint amount = min(to_spread, dest->cargo_cap - dest->cargo.TotalCount());
uint amount = std::min(to_spread, dest->cargo_cap - dest->cargo.TotalCount());
src->cargo.Shift(amount, &dest->cargo);
to_spread -= amount;
}
@@ -157,7 +157,7 @@ static void TransferCargo(Vehicle *old_veh, Vehicle *new_head, bool part_of_chai
}
if (dest->cargo_type != src->cargo_type) continue;
uint amount = min(src->cargo.TotalCount(), dest->cargo_cap - dest->cargo.TotalCount());
uint amount = std::min(src->cargo.TotalCount(), dest->cargo_cap - dest->cargo.TotalCount());
if (amount <= 0) continue;
src->cargo.Shift(amount, &dest->cargo);