Changeset - r23633:c6584a807d02
[Not reviewed]
master
0 1 0
glx - 5 years ago 2019-04-13 21:19:58
glx@openttd.org
Codechange: use std::sort in SaveHighScoreValueNetwork()
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/highscore.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)