mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 09:09:09 +00:00
Codechange: use std::sort() in GUIList
This commit is contained in:
@@ -93,21 +93,21 @@ private:
|
||||
Scrollbar *vscroll;
|
||||
|
||||
/** Sort the bridges by their index */
|
||||
static int CDECL BridgeIndexSorter(const BuildBridgeData *a, const BuildBridgeData *b)
|
||||
static bool BridgeIndexSorter(const BuildBridgeData &a, const BuildBridgeData &b)
|
||||
{
|
||||
return a->index - b->index;
|
||||
return a.index < b.index;
|
||||
}
|
||||
|
||||
/** Sort the bridges by their price */
|
||||
static int CDECL BridgePriceSorter(const BuildBridgeData *a, const BuildBridgeData *b)
|
||||
static bool BridgePriceSorter(const BuildBridgeData &a, const BuildBridgeData &b)
|
||||
{
|
||||
return a->cost - b->cost;
|
||||
return a.cost < b.cost;
|
||||
}
|
||||
|
||||
/** Sort the bridges by their maximum speed */
|
||||
static int CDECL BridgeSpeedSorter(const BuildBridgeData *a, const BuildBridgeData *b)
|
||||
static bool BridgeSpeedSorter(const BuildBridgeData &a, const BuildBridgeData &b)
|
||||
{
|
||||
return a->spec->speed - b->spec->speed;
|
||||
return a.spec->speed < b.spec->speed;
|
||||
}
|
||||
|
||||
void BuildBridge(uint8 i)
|
||||
|
Reference in New Issue
Block a user