diff: avoid redundantly clearing a flag
[gitweb.git] / config.c
index 6f0f8b30f39ba3a32d1a1795bdf12d78c5ea97f9..4a31e31ac30f8552e5116f319fecb8cf76182938 100644 (file)
--- a/config.c
+++ b/config.c
@@ -394,8 +394,7 @@ static int git_config_parse_key_1(const char *key, char **store_key, int *basele
 
 out_free_ret_1:
        if (store_key) {
-               free(*store_key);
-               *store_key = NULL;
+               FREE_AND_NULL(*store_key);
        }
        return -CONFIG_INVALID_KEY;
 }
@@ -1754,15 +1753,18 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha
        return 0;
 }
 
-static int config_set_element_cmp(const struct config_set_element *e1,
-                                const struct config_set_element *e2, const void *unused)
+static int config_set_element_cmp(const void *unused_cmp_data,
+                                 const struct config_set_element *e1,
+                                 const struct config_set_element *e2,
+                                 const void *unused_keydata)
 {
        return strcmp(e1->key, e2->key);
 }
 
 void git_configset_init(struct config_set *cs)
 {
-       hashmap_init(&cs->config_hash, (hashmap_cmp_fn)config_set_element_cmp, 0);
+       hashmap_init(&cs->config_hash, (hashmap_cmp_fn)config_set_element_cmp,
+                    NULL, 0);
        cs->hash_initialized = 1;
        cs->list.nr = 0;
        cs->list.alloc = 0;