{"thread":{"id":"41702","subject":"[PATCH v3] submodule-config: use hashmap_iter_first()","startedAt":"2016-03-16T07:46:31Z","lastAt":"2016-03-16T07:46:31Z","messageCount":1,"participants":["Alexander Kuleshov"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"280876","messageId":"1458114391-2235-1-git-send-email-kuleshovmail@gmail.com","threadId":"41702","inReplyTo":null,"subject":"[PATCH v3] submodule-config: use hashmap_iter_first()","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2016-03-16T07:46:31Z","receivedAt":"2016-03-16T07:46:31Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"The hashmap API provides hashmap_iter_first() helper for initialion\nand getting the first entry of a hashmap. Let's use it instead of\ndoing initialization manually and then get the first entry.\n\nThere are no functional changes, just cleanup.\n\nSigned-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\nReviewed-by: Stefan Beller <sbeller@google.com>\n---\nChangelog v3: commit message edited.\n\n submodule-config.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/submodule-config.c b/submodule-config.c\nindex b82d1fb..8ac5031 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -405,8 +405,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,\n \t\tstruct hashmap_iter iter;\n \t\tstruct submodule_entry *entry;\n \n-\t\thashmap_iter_init(&cache->for_name, &iter);\n-\t\tentry = hashmap_iter_next(&iter);\n+\t\tentry = hashmap_iter_first(&cache->for_name, &iter);\n \t\tif (!entry)\n \t\t\treturn NULL;\n \t\treturn entry->config;\n-- \n2.8.0.rc2.216.g1477fb2.dirty\n"}]}