]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
strv: drop redundant string_strv_hash_ops
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Jan 2025 03:17:19 +0000 (12:17 +0900)
committerMike Yuan <me@yhndnzj.com>
Mon, 27 Jan 2025 06:49:04 +0000 (07:49 +0100)
It is completely equivalent to string_hash_ops_free_strv_free.

src/basic/strv.c

index 5835a361c9c2740d522638ba1542d36489c0880d..d817140cc98e2ed68576562af15d814e2144223e 100644 (file)
@@ -1063,8 +1063,6 @@ int fputstrv(FILE *f, char * const *l, const char *separator, bool *space) {
         return 0;
 }
 
-DEFINE_PRIVATE_HASH_OPS_FULL(string_strv_hash_ops, char, string_hash_func, string_compare_func, free, char*, strv_free);
-
 static int string_strv_hashmap_put_internal(Hashmap *h, const char *key, const char *value) {
         char **l;
         int r;
@@ -1115,7 +1113,7 @@ int _string_strv_hashmap_put(Hashmap **h, const char *key, const char *value  HA
         assert(key);
         assert(value);
 
-        r = _hashmap_ensure_allocated(h, &string_strv_hash_ops  HASHMAP_DEBUG_PASS_ARGS);
+        r = _hashmap_ensure_allocated(h, &string_hash_ops_free_strv_free  HASHMAP_DEBUG_PASS_ARGS);
         if (r < 0)
                 return r;
 
@@ -1129,7 +1127,7 @@ int _string_strv_ordered_hashmap_put(OrderedHashmap **h, const char *key, const
         assert(key);
         assert(value);
 
-        r = _ordered_hashmap_ensure_allocated(h, &string_strv_hash_ops  HASHMAP_DEBUG_PASS_ARGS);
+        r = _ordered_hashmap_ensure_allocated(h, &string_hash_ops_free_strv_free  HASHMAP_DEBUG_PASS_ARGS);
         if (r < 0)
                 return r;