From b91abd3af98cca51221210198e2c9607055c19b2 Mon Sep 17 00:00:00 2001 From: glx Date: Tue, 17 Dec 2019 19:11:24 +0100 Subject: Codechange: Replace FOR_ALL_ROADSTOPS with range-based for loops --- src/saveload/station_sl.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/saveload/station_sl.cpp') diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 2df8d8167..1d3612ae3 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -129,12 +129,11 @@ void AfterLoadStations() void AfterLoadRoadStops() { /* First construct the drive through entries */ - RoadStop *rs; - FOR_ALL_ROADSTOPS(rs) { + for (RoadStop *rs : RoadStop::Iterate()) { if (IsDriveThroughStopTile(rs->xy)) rs->MakeDriveThrough(); } /* And then rebuild the data in those entries */ - FOR_ALL_ROADSTOPS(rs) { + for (RoadStop *rs : RoadStop::Iterate()) { if (!HasBit(rs->status, RoadStop::RSSFB_BASE_ENTRY)) continue; rs->GetEntry(DIAGDIR_NE)->Rebuild(rs); @@ -606,9 +605,7 @@ static void Ptrs_STNN() static void Save_ROADSTOP() { - RoadStop *rs; - - FOR_ALL_ROADSTOPS(rs) { + for (RoadStop *rs : RoadStop::Iterate()) { SlSetArrayIndex(rs->index); SlObject(rs, _roadstop_desc); } @@ -627,8 +624,7 @@ static void Load_ROADSTOP() static void Ptrs_ROADSTOP() { - RoadStop *rs; - FOR_ALL_ROADSTOPS(rs) { + for (RoadStop *rs : RoadStop::Iterate()) { SlObject(rs, _roadstop_desc); } } -- cgit v1.2.3-70-g09d2