]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hashmap: use assert_se() to make clang happy 24379/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 20 Aug 2022 19:57:18 +0000 (21:57 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 20 Aug 2022 19:57:18 +0000 (21:57 +0200)
Otherwise it complains about a set but unused variable:

```
../src/basic/hashmap.c:1070:48: error: variable 'n_rehashed' set but not used [-Werror,-Wunused-but-set-variable]
        unsigned old_n_buckets, new_n_buckets, n_rehashed, new_n_entries;
                                                       ^
                                                       1 error generated.
```

src/basic/hashmap.c

index 1fadaad9964866653c9fd3a2f170d752e866cec0..ddd329c874341fe2005be3ca72243dbfc5e972c0 100644 (file)
@@ -1190,7 +1190,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) {
                 } while (rehash_next);
         }
 
-        assert(n_rehashed == n_entries(h));
+        assert_se(n_rehashed == n_entries(h));
 
         return 1;
 }