Codechange: Use iterators and/or range-for on cargo related loops.
This commit is contained in:
committed by
Peter Nelson
parent
2a88e0fab3
commit
9602de474d
@@ -139,9 +139,9 @@ public:
|
||||
|
||||
void Save(Town *t) const override
|
||||
{
|
||||
SlSetStructListLength(NUM_CARGO);
|
||||
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||
SlObject(&t->supplied[i], this->GetDescription());
|
||||
SlSetStructListLength(std::size(t->supplied));
|
||||
for (auto &supplied : t->supplied) {
|
||||
SlObject(&supplied, this->GetDescription());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,9 +166,9 @@ public:
|
||||
|
||||
void Save(Town *t) const override
|
||||
{
|
||||
SlSetStructListLength(NUM_TE);
|
||||
for (size_t i = TE_BEGIN; i < TE_END; i++) {
|
||||
SlObject(&t->received[i], this->GetDescription());
|
||||
SlSetStructListLength(std::size(t->received));
|
||||
for (auto &received : t->received) {
|
||||
SlObject(&received, this->GetDescription());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user