mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 01:11:28 +00:00
Remove list_arbitrary_insert
This commit is contained in:
parent
51fa9de688
commit
382cd18367
|
@ -47,18 +47,6 @@ void list_insert(list_t *list, int index, void *item) {
|
|||
list->items[index] = item;
|
||||
}
|
||||
|
||||
// Added because IDK if it's safe to remove that memmove
|
||||
void list_arbitrary_insert(list_t *list, int index, void *item) {
|
||||
list_resize(list);
|
||||
if(index > list->capacity) {
|
||||
return;
|
||||
}
|
||||
if(list->length < index) {
|
||||
list->length = index;
|
||||
}
|
||||
list->items[index] = item;
|
||||
}
|
||||
|
||||
void list_del(list_t *list, int index) {
|
||||
list->length--;
|
||||
memmove(&list->items[index], &list->items[index + 1], sizeof(void*) * (list->length - index));
|
||||
|
|
|
@ -12,7 +12,6 @@ void list_free(list_t *list);
|
|||
void list_foreach(list_t *list, void (*callback)(void* item));
|
||||
void list_add(list_t *list, void *item);
|
||||
void list_insert(list_t *list, int index, void *item);
|
||||
void list_arbitrary_insert(list_t *list, int index, void *item);
|
||||
void list_del(list_t *list, int index);
|
||||
void list_cat(list_t *list, list_t *source);
|
||||
// See qsort. Remember to use *_qsort functions as compare functions,
|
||||
|
|
Loading…
Reference in a new issue