* Determines order of engines by introduction date * @param a first engine to compare * @param b second engine to compare * @return for descending order: returns true if a < b. Vice versa for ascending order */
| 127 | * @return for descending order: returns true if a < b. Vice versa for ascending order |
| 128 | */ |
| 129 | static bool EngineIntroDateSorter(const GUIEngineListItem &a, const GUIEngineListItem &b) |
| 130 | { |
| 131 | const auto va = Engine::Get(a.engine_id)->intro_date; |
| 132 | const auto vb = Engine::Get(b.engine_id)->intro_date; |
| 133 | const auto r = va - vb; |
| 134 | |
| 135 | /* Use EngineID to sort instead since we want consistent sorting */ |
| 136 | if (r == 0) return EngineNumberSorter(a, b); |
| 137 | return _engine_sort_direction ? r > 0 : r < 0; |
| 138 | } |
| 139 | |
| 140 | /* cached values for EngineNameSorter to spare many GetString() calls */ |
| 141 | static EngineID _last_engine[2] = { EngineID::Invalid(), EngineID::Invalid() }; |
nothing calls this directly
no test coverage detected