Skip to contentSkip to conversation

submodule-config: use hashmap_iter_first()

PATCH New Alexander Kuleshov 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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.

---
Changelog v3: commit message edited.

 submodule-config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
submodule-config.c +1 -2
index b82d1fb..8ac5031 100644
@@ -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;
Signature · 1 line
2.8.0.rc2.216.g1477fb2.dirty