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

@@ -144,10 +144,10 @@ bool LinkRefresher::HandleRefit(CargoID refit_cargo)
*/
void LinkRefresher::ResetRefit()
{
for (RefitList::iterator it(this->refit_capacities.begin()); it != this->refit_capacities.end(); ++it) {
if (it->remaining == it->capacity) continue;
this->capacities[it->cargo] += it->capacity - it->remaining;
it->remaining = it->capacity;
for (auto &it : this->refit_capacities) {
if (it.remaining == it.capacity) continue;
this->capacities[it.cargo] += it.capacity - it.remaining;
it.remaining = it.capacity;
}
}