Codechange: Use range-for when iterating station speclists. (#12212)

This replaces indexed access.
This commit is contained in:
Peter Nelson
2024-03-03 16:41:02 +00:00
committed by GitHub
parent b2ca6e1ac8
commit 8172e25273
3 changed files with 14 additions and 20 deletions

View File

@@ -612,11 +612,9 @@ void RoadStopUpdateCachedTriggers(BaseStation *st)
/* Combine animation trigger bitmask for all road stop specs
* of this station. */
for (uint i = 0; i < st->roadstop_speclist.size(); i++) {
const RoadStopSpec *ss = st->roadstop_speclist[i].spec;
if (ss != nullptr) {
st->cached_roadstop_anim_triggers |= ss->animation.triggers;
st->cached_roadstop_cargo_triggers |= ss->cargo_triggers;
}
for (const auto &sm : GetStationSpecList<RoadStopSpec>(st)) {
if (sm.spec == nullptr) continue;
st->cached_roadstop_anim_triggers |= sm.spec->animation.triggers;
st->cached_roadstop_cargo_triggers |= sm.spec->cargo_triggers;
}
}