{"thread":{"id":"41694","subject":"[PATCH v2] submodule-config: use hashmap_iter_first()","startedAt":"2016-03-15T19:13:15Z","lastAt":"2016-03-15T21:55:24Z","messageCount":4,"participants":["Alexander Kuleshov","Stefan Beller","Eric Sunshine","Jeff King"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"280821","messageId":"1458069195-20888-1-git-send-email-kuleshovmail@gmail.com","threadId":"41694","inReplyTo":null,"subject":"[PATCH v2] submodule-config: use hashmap_iter_first()","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2016-03-15T19:13:15Z","receivedAt":"2016-03-15T19:13:15Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"from the <hashmap.h> for simplification.\n\nSigned-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\nReviewed-by: Stefan Beller <sbeller@google.com>\n---\nChangelog: added missed Signof-off-by and function name fixed\nin the commit message.\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"},{"id":"280822","messageId":"CAGZ79kZ_wbJ2MGs_E-P_0eLk3JX_0QhT1c_BxqWCS+vrg8+xwA@mail.gmail.com","threadId":"41694","inReplyTo":"1458069195-20888-1-git-send-email-kuleshovmail@gmail.com","subject":"Re: [PATCH v2] submodule-config: use hashmap_iter_first()","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-15T19:21:36Z","receivedAt":"2016-03-15T19:21:36Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Mar 15, 2016 at 12:13 PM, Alexander Kuleshov\n<kuleshovmail@gmail.com> wrote:\n> from the <hashmap.h> for simplification.\n\nI think what Eric wanted to point out, was to not have a continuous sentence\nfrom commit message header to body.\n\nEither leave the body blank (as it is obvious) or write a whole sentence there:\n\n  [PATCH v2] submodule-config: use hashmap_iter_first()\n\n  The hashmap API offers the `hashmap_iter_first` function as initializing and\n  getting the first entry is a common pattern. Use that instead of\ndoing initialization\n  by hand and then get the first entry.\n\n\n\n>\n> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n> Reviewed-by: Stefan Beller <sbeller@google.com>\n> ---\n> Changelog: added missed Signof-off-by and function name fixed\n> in the commit message.\n>\n>  submodule-config.c | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n>\n> diff --git a/submodule-config.c b/submodule-config.c\n> index 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>                 struct hashmap_iter iter;\n>                 struct submodule_entry *entry;\n>\n> -               hashmap_iter_init(&cache->for_name, &iter);\n> -               entry = hashmap_iter_next(&iter);\n> +               entry = hashmap_iter_first(&cache->for_name, &iter);\n>                 if (!entry)\n>                         return NULL;\n>                 return entry->config;\n> --\n> 2.8.0.rc2.216.g1477fb2.dirty\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"280825","messageId":"CAPig+cRJKsdkGEr-_Z7pxKW-t9X45+Z4ZLzgk=aprMHMdmLNqg@mail.gmail.com","threadId":"41694","inReplyTo":"CAGZ79kZ_wbJ2MGs_E-P_0eLk3JX_0QhT1c_BxqWCS+vrg8+xwA@mail.gmail.com","subject":"Re: [PATCH v2] submodule-config: use hashmap_iter_first()","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-03-15T19:30:07Z","receivedAt":"2016-03-15T19:30:07Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Mar 15, 2016 at 3:21 PM, Stefan Beller <sbeller@google.com> wrote:\n> On Tue, Mar 15, 2016 at 12:13 PM, Alexander Kuleshov\n> <kuleshovmail@gmail.com> wrote:\n>> from the <hashmap.h> for simplification.\n>\n> I think what Eric wanted to point out, was to not have a continuous sentence\n> from commit message header to body.\n\nYes, thanks for clarifying that.\n\n> Either leave the body blank (as it is obvious) or write a whole sentence there:\n>\n>   [PATCH v2] submodule-config: use hashmap_iter_first()\n>\n>   The hashmap API offers the `hashmap_iter_first` function as initializing and\n>   getting the first entry is a common pattern. Use that instead of\n> doing initialization\n>   by hand and then get the first entry.\n"},{"id":"280849","messageId":"20160315215524.GB30011@sigill.intra.peff.net","threadId":"41694","inReplyTo":"CAGZ79kZ_wbJ2MGs_E-P_0eLk3JX_0QhT1c_BxqWCS+vrg8+xwA@mail.gmail.com","subject":"Re: [PATCH v2] submodule-config: use hashmap_iter_first()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-15T21:55:24Z","receivedAt":"2016-03-15T21:55:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 15, 2016 at 12:21:36PM -0700, Stefan Beller wrote:\n\n> On Tue, Mar 15, 2016 at 12:13 PM, Alexander Kuleshov\n> <kuleshovmail@gmail.com> wrote:\n> > from the <hashmap.h> for simplification.\n> \n> I think what Eric wanted to point out, was to not have a continuous sentence\n> from commit message header to body.\n> \n> Either leave the body blank (as it is obvious) or write a whole sentence there:\n> \n>   [PATCH v2] submodule-config: use hashmap_iter_first()\n> \n>   The hashmap API offers the `hashmap_iter_first` function as initializing and\n>   getting the first entry is a common pattern. Use that instead of\n> doing initialization\n>   by hand and then get the first entry.\n\nWhile we are nitpicking...:)\n\nAs a reader (either reviewing now, or looking at the change later in\ngit-log), I think my biggest question is: why?  Do we expect this to\nchange behavior, or is this just a cleanup? There's nothing wrong with\n\"just\" a cleanup, but knowing that is the intent is helpful.\n\n-Peff\n"}]}