Codechange: Use iterators and/or range-for on cargo related loops.

This commit is contained in:
Peter Nelson
2023-10-18 20:49:01 +01:00
committed by Peter Nelson
parent 2a88e0fab3
commit 9602de474d
16 changed files with 79 additions and 89 deletions

View File

@@ -83,8 +83,8 @@ Station::Station(TileIndex tile) :
Station::~Station()
{
if (CleaningPool()) {
for (CargoID c = 0; c < NUM_CARGO; c++) {
this->goods[c].cargo.OnCleanPool();
for (GoodsEntry &ge : this->goods) {
ge.cargo.OnCleanPool();
}
return;
}
@@ -148,8 +148,8 @@ Station::~Station()
/* Remove all news items */
DeleteStationNews(this->index);
for (CargoID c = 0; c < NUM_CARGO; c++) {
this->goods[c].cargo.Truncate();
for (GoodsEntry &ge : this->goods) {
ge.cargo.Truncate();
}
CargoPacket::InvalidateAllFrom(this->index);