MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / EngList_SortPartial

Function EngList_SortPartial

src/engine_gui.cpp:369–375  ·  view source on GitHub ↗

* Sort selected range of items (on indices @ ) * @param el list to be sorted * @param compare function for evaluation of the quicksort * @param begin start of sorting * @param num_items count of items to be sorted */

Source from the content-addressed store, hash-verified

367 * @param num_items count of items to be sorted
368 */
369void EngList_SortPartial(GUIEngineList &el, EngList_SortTypeFunction compare, size_t begin, size_t num_items)
370{
371 if (num_items < 2) return;
372 assert(begin < el.size());
373 assert(begin + num_items <= el.size());
374 std::sort(el.begin() + begin, el.begin() + begin + num_items, compare);
375}
376

Callers 1

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected