summaryrefslogtreecommitdiffstats
path: root/src/libudev
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-02-01 18:34:20 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-02-01 18:34:23 +0100
commit65c637ad2c2dc1fcddac01f104cdb146a88af852 (patch)
tree488ee7bc00d0ff4c9ba1e900f2eb25e926935bb3 /src/libudev
parentlibudev: also drop the entry from LIST even if unique flag is set (diff)
downloadsystemd-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.c2
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);