diff --git a/simple_singly_linked_list.c b/simple_singly_linked_list.c index ca0e960..4a73bde 100644 --- a/simple_singly_linked_list.c +++ b/simple_singly_linked_list.c @@ -154,10 +154,6 @@ int list_get_size(IntList list) { return 0; } - if (list_is_empty(list)) { - return 0; - } - int size = 0; IntListNode current = list->head; while (current != 0) { @@ -178,7 +174,7 @@ int list_get_size(IntList list) { * `false ` otherwise. */ bool list_contains(IntList list, int value) { - if (!list_is_valid(list) || list_is_empty(list)) { + if (!list_is_valid(list)) { return false; } @@ -202,7 +198,7 @@ bool list_contains(IntList list, int value) { * is not available. */ int list_get_at(IntList list, unsigned int index) { - if (!list_is_valid(list) || list_is_empty(list)) { + if (!list_is_valid(list)) { return 0; }