From 382cd18367124f627aaba4983cfe4a884b6d00ae Mon Sep 17 00:00:00 2001 From: Nuew Date: Thu, 24 Mar 2016 18:18:46 -0400 Subject: [PATCH] Remove list_arbitrary_insert --- common/list.c | 12 ------------ include/list.h | 1 - 2 files changed, 13 deletions(-) diff --git a/common/list.c b/common/list.c index 49e04952..a7585a31 100644 --- a/common/list.c +++ b/common/list.c @@ -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)); diff --git a/include/list.h b/include/list.h index 6343ca27..b2e26f95 100644 --- a/include/list.h +++ b/include/list.h @@ -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,