From: Alexander Kuleshov Date: Wed, 16 Mar 2016 07:46:31 +0000 (+0600) Subject: submodule-config: use hashmap_iter_first() X-Git-Tag: v2.8.2~4^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/01d98e8a5dc0c1951450bed88e12d0af1a01cb20?ds=inline;hp=--cc 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 Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- 01d98e8a5dc0c1951450bed88e12d0af1a01cb20 diff --git a/submodule-config.c b/submodule-config.c index fe8ceabf30..6ea31dd363 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;