equal
deleted
inserted
replaced
136 */ |
136 */ |
137 void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items) |
137 void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items) |
138 { |
138 { |
139 assert(begin <= (uint)el->size()); |
139 assert(begin <= (uint)el->size()); |
140 assert(begin + num_items <= (uint)el->size()); |
140 assert(begin + num_items <= (uint)el->size()); |
|
141 if (num_items < 2) return; |
141 qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare); |
142 qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare); |
142 } |
143 } |
143 |
144 |
144 |
145 |
145 /** Sets cached values in Player::num_vehicles and Group::num_vehicles |
146 /** Sets cached values in Player::num_vehicles and Group::num_vehicles |