Remove list_arbitrary_insert

This commit is contained in:
Nuew 2016-03-24 18:18:46 -04:00
parent 51fa9de688
commit 382cd18367
2 changed files with 0 additions and 13 deletions

View file

@ -47,18 +47,6 @@ void list_insert(list_t *list, int index, void *item) {
list->items[index] = 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) { void list_del(list_t *list, int index) {
list->length--; list->length--;
memmove(&list->items[index], &list->items[index + 1], sizeof(void*) * (list->length - index)); memmove(&list->items[index], &list->items[index + 1], sizeof(void*) * (list->length - index));

View file

@ -12,7 +12,6 @@ void list_free(list_t *list);
void list_foreach(list_t *list, void (*callback)(void* item)); void list_foreach(list_t *list, void (*callback)(void* item));
void list_add(list_t *list, void *item); void list_add(list_t *list, void *item);
void list_insert(list_t *list, int index, 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_del(list_t *list, int index);
void list_cat(list_t *list, list_t *source); void list_cat(list_t *list, list_t *source);
// See qsort. Remember to use *_qsort functions as compare functions, // See qsort. Remember to use *_qsort functions as compare functions,