src/engine_gui.cpp
changeset 10765 34cd0fa4baed
parent 10764 e46596b87826
child 11035 e1ee65151624
equal deleted inserted replaced
10764:e46596b87826 10765:34cd0fa4baed
   212  * @param begin start of sorting
   212  * @param begin start of sorting
   213  * @param num_items count of items to be sorted
   213  * @param num_items count of items to be sorted
   214  */
   214  */
   215 void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items)
   215 void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items)
   216 {
   216 {
       
   217 	if (num_items < 2) return;
   217 	assert(begin < el->Length());
   218 	assert(begin < el->Length());
   218 	assert(begin + num_items <= el->Length());
   219 	assert(begin + num_items <= el->Length());
   219 	if (num_items < 2) return;
       
   220 	qsort(el->Get(begin), num_items, sizeof(*el->Begin()), compare);
   220 	qsort(el->Get(begin), num_items, sizeof(*el->Begin()), compare);
   221 }
   221 }
   222 
   222