Skip to content

Commit 01d98e8

Browse files
0xAXgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0feb1b commit 01d98e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

submodule-config.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
392392
struct hashmap_iter iter;
393393
struct submodule_entry *entry;
394394

395-
hashmap_iter_init(&cache->for_name, &iter);
396-
entry = hashmap_iter_next(&iter);
395+
entry = hashmap_iter_first(&cache->for_name, &iter);
397396
if (!entry)
398397
return NULL;
399398
return entry->config;

0 commit comments

Comments
 (0)