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

@@ -550,9 +550,8 @@ class NIHTown : public NIHelper {
{
Town *t = Town::Get(index);
std::list<PersistentStorage *>::iterator iter;
for (iter = t->psa_list.begin(); iter != t->psa_list.end(); iter++) {
if ((*iter)->grfid == grfid) return (int32 *)(&(*iter)->storage[0]);
for (const auto &it : t->psa_list) {
if (it->grfid == grfid) return &it->storage[0];
}
return nullptr;