summaryrefslogtreecommitdiff
path: root/src/highscore.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-14 17:22:38 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commit3a14cea068d130e11b5d9dde11d4451dd7dec453 (patch)
tree7afd5a1160872aeba8a630c2915a8168cbc483dd /src/highscore.cpp
parent68f22134cb35267d6fa01134a385d3854fda1787 (diff)
downloadopenttd-3a14cea068d130e11b5d9dde11d4451dd7dec453.tar.xz
Codechange: Replace FOR_ALL_COMPANIES with range-based for loops
Diffstat (limited to 'src/highscore.cpp')
-rw-r--r--src/highscore.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/highscore.cpp b/src/highscore.cpp
index ccdf4d79f..d8fe348fe 100644
--- a/src/highscore.cpp
+++ b/src/highscore.cpp
@@ -87,13 +87,12 @@ static bool HighScoreSorter(const Company * const &a, const Company * const &b)
*/
int8 SaveHighScoreValueNetwork()
{
- const Company *c;
const Company *cl[MAX_COMPANIES];
uint count = 0;
int8 company = -1;
/* Sort all active companies with the highest score first */
- FOR_ALL_COMPANIES(c) cl[count++] = c;
+ for (const Company *c : Company::Iterate()) cl[count++] = c;
std::sort(std::begin(cl), std::begin(cl) + count, HighScoreSorter);