summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-17 22:04:09 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commitee7a8eebca774666cd3625431a86dd05113b5e88 (patch)
tree7a7843a2ffae14db6e15933eb1bb29923945ddb0 /src/openttd.cpp
parent0b489f99249a8c62ee3826e490ed17f29377581c (diff)
downloadopenttd-ee7a8eebca774666cd3625431a86dd05113b5e88.tar.xz
Codechange: Replace FOR_ALL_TOWNS with range-based for loops
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index c7af56be1..48d889aef 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1188,8 +1188,7 @@ static void CheckCaches()
/* Check the town caches. */
std::vector<TownCache> old_town_caches;
- Town *t;
- FOR_ALL_TOWNS(t) {
+ for (const Town *t : Town::Iterate()) {
old_town_caches.push_back(t->cache);
}
@@ -1198,7 +1197,7 @@ static void CheckCaches()
RebuildSubsidisedSourceAndDestinationCache();
uint i = 0;
- FOR_ALL_TOWNS(t) {
+ for (Town *t : Town::Iterate()) {
if (MemCmpT(old_town_caches.data() + i, &t->cache) != 0) {
DEBUG(desync, 2, "town cache mismatch: town %i", (int)t->index);
}