Removed the empty checks when asked from Mr. Schraml

This commit is contained in:
MarcUs7i 2025-03-20 16:05:30 +01:00
parent 0a6a739b6f
commit 403a3401a2

View file

@ -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;
}