Codechange: Use range-for iteration.

This commit is contained in:
Peter Nelson
2023-05-07 12:09:54 +01:00
committed by PeterN
parent cef3a2570d
commit e6740046ee
22 changed files with 169 additions and 193 deletions

View File

@@ -380,8 +380,7 @@ void VehicleCargoList::AddToMeta(const CargoPacket *cp, MoveToAction action)
*/
void VehicleCargoList::AgeCargo()
{
for (ConstIterator it(this->packets.begin()); it != this->packets.end(); it++) {
CargoPacket *cp = *it;
for (const auto &cp : this->packets) {
/* If we're at the maximum, then we can't increase no more. */
if (cp->days_in_transit == UINT16_MAX) continue;