]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/set: const-ify set_first()
authorAnita Zhang <the.anitazha@gmail.com>
Sat, 5 Oct 2019 01:14:19 +0000 (18:14 -0700)
committerAnita Zhang <the.anitazha@gmail.com>
Mon, 7 Oct 2019 19:02:12 +0000 (12:02 -0700)
set_steal_first() is the version that modifies Set so this one should be
const.

src/basic/set.h

index 2bb26c68b8c6a9e6d5efc1419bab8f995d5d8d0e..5f1956177e016669877fe90140aca8e9abd63b4a 100644 (file)
@@ -102,8 +102,8 @@ static inline void *set_steal_first(Set *s) {
 /* no set_steal_first_key */
 /* no set_first_key */
 
-static inline void *set_first(Set *s) {
-        return internal_hashmap_first_key_and_value(HASHMAP_BASE(s), false, NULL);
+static inline void *set_first(const Set *s) {
+        return internal_hashmap_first_key_and_value(HASHMAP_BASE((Set *) s), false, NULL);
 }
 
 /* no set_next */