Skip to content

Commit

Permalink
Condense conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
deathgrippin committed Jun 10, 2020
1 parent 391699c commit 35277dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions common/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ struct genlist *list_lookup(struct genlist *l, long key)
struct genlist *curr = l->next;
while (curr != l && curr->key != key)
curr = curr->next;
if (curr == l)
return 0;
else
return curr;
return curr == l ? 0 : curr;
}

struct genlist *list_insert(struct genlist *l, long key, void *data)
Expand Down

0 comments on commit 35277dd

Please sign in to comment.