Merge branch 'ak/use-hashmap-iter-first-in-submodule-config'
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 Apr 2016 21:12:29 +0000 (14:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Apr 2016 21:12:29 +0000 (14:12 -0700)
Minor code cleanup.

* ak/use-hashmap-iter-first-in-submodule-config:
submodule-config: use hashmap_iter_first()

submodule-config.c
index b82d1fbb22efd4c7279edd05955c38ba8df5311b..8ac5031ade2e71b2ac1a70a9130b3eef25eebc35 100644 (file)
@@ -405,8 +405,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
                struct hashmap_iter iter;
                struct submodule_entry *entry;
 
-               hashmap_iter_init(&cache->for_name, &iter);
-               entry = hashmap_iter_next(&iter);
+               entry = hashmap_iter_first(&cache->for_name, &iter);
                if (!entry)
                        return NULL;
                return entry->config;