{"thread":{"id":"55632","subject":"[PATCH] Fix a small flaw in the comment of strmap.h","startedAt":"2021-05-06T08:21:55Z","lastAt":"2021-05-06T08:49:54Z","messageCount":3,"participants":["Teng Long","Junio C Hamano","dyrone teng"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"423751","messageId":"20210506081936.29887-1-dyroneteng@gmail.com","threadId":"55632","inReplyTo":null,"subject":"[PATCH] Fix a small flaw in the comment of strmap.h","fromName":"Teng Long","fromEmail":"dyroneteng@gmail.com","sentAt":"2021-05-06T08:19:36Z","receivedAt":"2021-05-06T08:21:55Z","isPatch":true,"sender":{"key":"dyroneteng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7803958?v=4"},"body":"Signed-off-by: Teng Long <dyroneteng@gmail.com>\n---\n strmap.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/strmap.h b/strmap.h\nindex 1e152d832d..0d1d00d14e 100644\n--- a/strmap.h\n+++ b/strmap.h\n@@ -78,7 +78,7 @@ struct strmap_entry *strmap_get_entry(struct strmap *map, const char *str);\n void *strmap_get(struct strmap *map, const char *str);\n \n /*\n- * Return non-zero iff \"str\" is present in the map. This differs from\n+ * Return non-zero if \"str\" is present in the map. This differs from\n  * strmap_get() in that it can distinguish entries with a NULL data pointer.\n  */\n int strmap_contains(struct strmap *map, const char *str);\n-- \n2.31.1\n\n"},{"id":"423757","messageId":"xmqq35v0z1uw.fsf@gitster.g","threadId":"55632","inReplyTo":"20210506081936.29887-1-dyroneteng@gmail.com","subject":"Re: [PATCH] Fix a small flaw in the comment of strmap.h","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-05-06T08:46:15Z","receivedAt":"2021-05-06T08:46:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Teng Long <dyroneteng@gmail.com> writes:\n\n> Subject: Re: [PATCH] Fix a small flaw in the comment of strmap.h\n\ncf. Documentation/SubmittingPatches::summary-section\n\n> Signed-off-by: Teng Long <dyroneteng@gmail.com>\n> ---\n>  strmap.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/strmap.h b/strmap.h\n> index 1e152d832d..0d1d00d14e 100644\n> --- a/strmap.h\n> +++ b/strmap.h\n> @@ -78,7 +78,7 @@ struct strmap_entry *strmap_get_entry(struct strmap *map, const char *str);\n>  void *strmap_get(struct strmap *map, const char *str);\n>  \n>  /*\n> - * Return non-zero iff \"str\" is present in the map. This differs from\n> + * Return non-zero if \"str\" is present in the map. This differs from\n\nThe original is correct; this function returns a non-zero value if\nand only if (iff is a common abbreviation for this expression) \"str\"\nis in the map, implying that when \"str\" is not in the map, the\ncaller can rest assured that the function will not return a non-zero\nvalue (in other words, the caller is guaranteed to receive zero).\n\nIf you change that to \"if\", the comment no longer says what happens\nwhen \"str\" is *not* present in the map, which is making it worse.\n"},{"id":"423758","messageId":"CADMgQSRg559o_MLSsPvAU3c7_2uWWm0LuBkPZaQ-PD=oqqAEJQ@mail.gmail.com","threadId":"55632","inReplyTo":"xmqq35v0z1uw.fsf@gitster.g","subject":"Re: [PATCH] Fix a small flaw in the comment of strmap.h","fromName":"dyrone teng","fromEmail":"dyroneteng@gmail.com","sentAt":"2021-05-06T08:49:36Z","receivedAt":"2021-05-06T08:49:54Z","isPatch":true,"sender":{"key":"dyroneteng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7803958?v=4"},"body":">The original is correct; this function returns a non-zero value if\n>and only if (iff is a common abbreviation for this expression) \"str\"\n>is in the map, implying that when \"str\" is not in the map, the\n>caller can rest assured that the function will not return a non-zero\n>value (in other words, the caller is guaranteed to receive zero).\n\n>If you change that to \"if\", the comment no longer says what happens\n>when \"str\" is *not* present in the map, which is making it worse.\n\nThanks, got it.\n\nJunio C Hamano <gitster@pobox.com> 于2021年5月6日周四 下午4:46写道：\n>\n> Teng Long <dyroneteng@gmail.com> writes:\n>\n> > Subject: Re: [PATCH] Fix a small flaw in the comment of strmap.h\n>\n> cf. Documentation/SubmittingPatches::summary-section\n>\n> > Signed-off-by: Teng Long <dyroneteng@gmail.com>\n> > ---\n> >  strmap.h | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/strmap.h b/strmap.h\n> > index 1e152d832d..0d1d00d14e 100644\n> > --- a/strmap.h\n> > +++ b/strmap.h\n> > @@ -78,7 +78,7 @@ struct strmap_entry *strmap_get_entry(struct strmap *map, const char *str);\n> >  void *strmap_get(struct strmap *map, const char *str);\n> >\n> >  /*\n> > - * Return non-zero iff \"str\" is present in the map. This differs from\n> > + * Return non-zero if \"str\" is present in the map. This differs from\n>\n> The original is correct; this function returns a non-zero value if\n> and only if (iff is a common abbreviation for this expression) \"str\"\n> is in the map, implying that when \"str\" is not in the map, the\n> caller can rest assured that the function will not return a non-zero\n> value (in other words, the caller is guaranteed to receive zero).\n>\n> If you change that to \"if\", the comment no longer says what happens\n> when \"str\" is *not* present in the map, which is making it worse.\n"}]}