diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-01 18:34:20 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-01 18:34:23 +0100 |
commit | 65c637ad2c2dc1fcddac01f104cdb146a88af852 (patch) | |
tree | 488ee7bc00d0ff4c9ba1e900f2eb25e926935bb3 /src/libudev | |
parent | libudev: also drop the entry from LIST even if unique flag is set (diff) | |
download | systemd-65c637ad2c2dc1fcddac01f104cdb146a88af852.tar.xz systemd-65c637ad2c2dc1fcddac01f104cdb146a88af852.zip |
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.
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c index d42008e48d..d992d1879b 100644 --- a/src/libudev/libudev-list.c +++ b/src/libudev/libudev-list.c @@ -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); |