summaryrefslogtreecommitdiff
path: root/submodule-config.c
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2016-03-16 07:46:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-23 20:39:13 (GMT)
commit01d98e8a5dc0c1951450bed88e12d0af1a01cb20 (patch)
tree82374fcbf2353ca5aa09e77a1c05e6bffc5ab291 /submodule-config.c
parenta0feb1b1870fbb74f65d6a8951e4b2e2a2347ecf (diff)
downloadgit-01d98e8a5dc0c1951450bed88e12d0af1a01cb20.zip
git-01d98e8a5dc0c1951450bed88e12d0af1a01cb20.tar.gz
git-01d98e8a5dc0c1951450bed88e12d0af1a01cb20.tar.bz2
submodule-config: use hashmap_iter_first()
The hashmap API provides hashmap_iter_first() helper for initialion and getting the first entry of a hashmap. Let's use it instead of doing initialization manually and then get the first entry. There are no functional changes, just cleanup. Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule-config.c')
-rw-r--r--submodule-config.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/submodule-config.c b/submodule-config.c
index fe8ceab..6ea31dd 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -392,8 +392,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;