Removed the empty checks when asked from Mr. Schraml
This commit is contained in:
parent
0a6a739b6f
commit
403a3401a2
1 changed files with 2 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue