libudev: unset uptodate flag before free()ing entries

udev_list_entry_free() also removes the entry from LIST if the flag is
set. This slightly optimizes the cleanup logic.
This commit is contained in:
Yu Watanabe
2021-02-02 02:34:20 +09:00
parent 8e5ce38727
commit 65c637ad2c

View File

@@ -115,8 +115,8 @@ void udev_list_cleanup(struct udev_list *list) {
return;
if (list->unique) {
hashmap_clear_with_destructor(list->unique_entries, udev_list_entry_free);
list->uptodate = false;
hashmap_clear_with_destructor(list->unique_entries, udev_list_entry_free);
} else
LIST_FOREACH_SAFE(entries, i, n, list->entries)
udev_list_entry_free(i);