X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Fhashmap.c;h=8225b8ebccd5e742eea1f90b42091c1c48238254;hp=4c517059f68cbc1b3c7b41aaeae4192c3e4f359a;hb=dd0124f6cb6ff7da1ce8be23ec7e1137fe15958d;hpb=923041cb0ab7c1795e74fa1ce4b38a6114727a3c diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 4c517059f..8225b8ebc 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -886,15 +886,15 @@ int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key) { unsigned h_hash, other_hash; struct hashmap_entry *e; - if (!other) - return 0; - assert(h); h_hash = bucket_hash(h, key); if (hash_scan(h, h_hash, key)) return -EEXIST; + if (!other) + return -ENOENT; + other_hash = bucket_hash(other, key); e = hash_scan(other, other_hash, key); if (!e) @@ -945,7 +945,6 @@ void *hashmap_next(Hashmap *h, const void *key) { unsigned hash; struct hashmap_entry *e; - assert(h); assert(key); if (!h)