Introduce xbps_array_add_first() to insert obj at the head of array.
The behaviour of this routine mimics the existing xbps_array_add() with the difference that stored objects are moved to the right to insert our object as the first element on the array. Use this to add replaced packages in the transaction array at the head rather than at the end, to preserve the proper sorting order.
This commit is contained in:
@@ -59,6 +59,7 @@ prop_object_iterator_t prop_array_iterator(prop_array_t);
|
||||
prop_object_t prop_array_get(prop_array_t, unsigned int);
|
||||
bool prop_array_set(prop_array_t, unsigned int, prop_object_t);
|
||||
bool prop_array_add(prop_array_t, prop_object_t);
|
||||
bool prop_array_add_first(prop_array_t, prop_object_t);
|
||||
void prop_array_remove(prop_array_t, unsigned int);
|
||||
|
||||
bool prop_array_equals(prop_array_t, prop_array_t);
|
||||
|
Reference in New Issue
Block a user