summaryrefslogtreecommitdiff
path: root/src/engine_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine_gui.cpp')
-rw-r--r--src/engine_gui.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp
index 4e9dc30d9..eb14b5d8a 100644
--- a/src/engine_gui.cpp
+++ b/src/engine_gui.cpp
@@ -325,11 +325,8 @@ void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID eng
*/
void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare)
{
- size_t size = el->size();
- /* out-of-bounds access at the next line for size == 0 (even with operator[] at some systems)
- * generally, do not sort if there are less than 2 items */
- if (size < 2) return;
- QSortT(el->data(), size, compare);
+ if (el->size() < 2) return;
+ std::sort(el->begin(), el->end(), compare);
}
/**
@@ -344,6 +341,6 @@ void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, ui
if (num_items < 2) return;
assert(begin < el->size());
assert(begin + num_items <= el->size());
- QSortT(el->data() + begin, num_items, compare);
+ std::sort(el->begin() + begin, el->begin() + begin + num_items, compare);
}