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>

Alexander Kuleshov committed Mar 16, 2016 at 13:46 UTC 01d98e8a5dc0c1951450bed88e12d0af1a01cb20
1 file changed +1 -2
submodule-config.c
+1 -2
@@ -392,8 +392,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
392 struct hashmap_iter iter;
393 struct submodule_entry *entry;
394
395 - hashmap_iter_init(&cache->for_name, &iter);
396 - entry = hashmap_iter_next(&iter);
395 + entry = hashmap_iter_first(&cache->for_name, &iter);
396 if (!entry)
397 return NULL;
398 return entry->config;