diff options
author | glx <glx@openttd.org> | 2019-04-13 23:19:58 +0200 |
---|---|---|
committer | glx22 <glx22@users.noreply.github.com> | 2019-04-18 21:49:34 +0200 |
commit | 60da17418a190eb262eda5eadb03954a8b98a0e6 (patch) | |
tree | 7a0ecf8344b1a01d20e01871921615f5deb4e55c | |
parent | 9388fa2aa12db72b80d10def4752d5c37bb806cb (diff) | |
download | openttd-60da17418a190eb262eda5eadb03954a8b98a0e6.tar.xz |
Codechange: use std::sort in SaveHighScoreValueNetwork()
-rw-r--r-- | src/highscore.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/highscore.cpp b/src/highscore.cpp index a69bdc46a..71b31c384 100644 --- a/src/highscore.cpp +++ b/src/highscore.cpp @@ -79,9 +79,9 @@ int8 SaveHighScoreValue(const Company *c) } /** Sort all companies given their performance */ -static int CDECL HighScoreSorter(const Company * const *a, const Company * const *b) +static bool HighScoreSorter(const Company * const &a, const Company * const &b) { - return (*b)->old_economy[0].performance_history - (*a)->old_economy[0].performance_history; + return b->old_economy[0].performance_history < a->old_economy[0].performance_history; } /** @@ -98,7 +98,7 @@ int8 SaveHighScoreValueNetwork() /* Sort all active companies with the highest score first */ FOR_ALL_COMPANIES(c) cl[count++] = c; - QSortT(cl, count, &HighScoreSorter); + std::sort(std::begin(cl), std::begin(cl) + count, HighScoreSorter); { uint i; |