Codechange: Use standard iterator-erase-loop pattern.
This commit is contained in:
@@ -30,12 +30,11 @@ static void ClearCargoMonitoring(CargoMonitorMap &cargo_monitor_map, CompanyID c
|
||||
return;
|
||||
}
|
||||
|
||||
CargoMonitorMap::iterator next;
|
||||
for (CargoMonitorMap::iterator it = cargo_monitor_map.begin(); it != cargo_monitor_map.end(); it = next) {
|
||||
next = it;
|
||||
next++;
|
||||
for (auto it = cargo_monitor_map.begin(); it != cargo_monitor_map.end(); /* nothing */) {
|
||||
if (DecodeMonitorCompany(it->first) == company) {
|
||||
cargo_monitor_map.erase(it);
|
||||
it = cargo_monitor_map.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user