From: Mike Yuan Date: Sat, 11 Nov 2023 07:53:38 +0000 (+0800) Subject: core/unit: remove unneeded comparison for hashmap_remove_value X-Git-Tag: v255-rc2~38^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c2beeb04fe9b8641538caeba4907ac7a97381f2;p=thirdparty%2Fsystemd.git core/unit: remove unneeded comparison for hashmap_remove_value hashmap_remove_value returns NULL if the value in the hashmap doesn't match with the one provided by the caller. --- diff --git a/src/core/unit.c b/src/core/unit.c index 60f461bbfdb..d9d23106b88 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2944,7 +2944,7 @@ void unit_unwatch_pidref(Unit *u, PidRef *pid) { if (uu == u) /* OK, we are in the first table. Let's remove it there then, and we are done already. */ - assert_se(hashmap_remove_value(u->manager->watch_pids, pid2, uu) == uu); + assert_se(hashmap_remove_value(u->manager->watch_pids, pid2, uu)); else { /* We weren't in the first table, then let's consult the 2nd table that points to an array */ PidRef *pid3 = NULL; @@ -2962,7 +2962,7 @@ void unit_unwatch_pidref(Unit *u, PidRef *pid) { if (m == 0) { /* The array is now empty, remove the entire entry */ - assert_se(hashmap_remove_value(u->manager->watch_pids_more, pid3, array) == array); + assert_se(hashmap_remove_value(u->manager->watch_pids_more, pid3, array)); free(array); } else { /* The array is not empty, but let's make sure the entry is not keyed by the PidRef