From c25e9cee24ac4898c25905321ff37c20a89bbe0d Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Fri, 8 Jun 2018 13:57:08 +0100 Subject: [PATCH] Conditionals tests in cfulist_delete_data_with_free_fn() were simplified --- src/cfulist.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cfulist.c b/src/cfulist.c index 4bb1524..f32c7e0 100644 --- a/src/cfulist.c +++ b/src/cfulist.c @@ -429,10 +429,7 @@ cfulist_delete_data_with_free_fn(cfulist_t *list, void *data, cfulist_free_fn_t cfulist_entry *entry = list->entries; while (entry) { - if (entry->data != data) { - entry = entry->next; - continue; - } else { + if (entry->data == data) { if (!entry->prev) { if (entry->next) { assert(list->num_entries > 1); @@ -451,6 +448,7 @@ cfulist_delete_data_with_free_fn(cfulist_t *list, void *data, cfulist_free_fn_t --list->num_entries; break; } + entry = entry->next; } unlock_list(list);