{"thread":{"id":"43015","subject":"[PATCH] merge-recursive: use STRING_LIST_INIT_NODUP","startedAt":"2016-08-05T20:42:26Z","lastAt":"2016-08-07T08:51:13Z","messageCount":2,"participants":["René Scharfe","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"293231","messageId":"57A4FA24.4050505@web.de","threadId":"43015","inReplyTo":null,"subject":"[PATCH] merge-recursive: use STRING_LIST_INIT_NODUP","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2016-08-05T20:42:12Z","receivedAt":"2016-08-05T20:42:26Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Initialize a string_list right when it's defined.  That's shorter, saves\na function call and makes it more obvious that we're using the NODUP\nvariant here.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n merge-recursive.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex a4a1195..97e6737 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -409,7 +409,7 @@ static void record_df_conflict_files(struct merge_options *o,\n \t * and the file need to be present, then the D/F file will be\n \t * reinstated with a new unique name at the time it is processed.\n \t */\n-\tstruct string_list df_sorted_entries;\n+\tstruct string_list df_sorted_entries = STRING_LIST_INIT_NODUP;\n \tconst char *last_file = NULL;\n \tint last_len = 0;\n \tint i;\n@@ -422,7 +422,6 @@ static void record_df_conflict_files(struct merge_options *o,\n \t\treturn;\n \n \t/* Ensure D/F conflicts are adjacent in the entries list. */\n-\tmemset(&df_sorted_entries, 0, sizeof(struct string_list));\n \tfor (i = 0; i < entries->nr; i++) {\n \t\tstruct string_list_item *next = &entries->items[i];\n \t\tstring_list_append(&df_sorted_entries, next->string)->util =\n-- \n2.9.2\n\n"},{"id":"293317","messageId":"alpine.DEB.2.20.1608071049510.5786@virtualbox","threadId":"43015","inReplyTo":"57A4FA24.4050505@web.de","subject":"Re: [PATCH] merge-recursive: use STRING_LIST_INIT_NODUP","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-08-07T08:51:01Z","receivedAt":"2016-08-07T08:51:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi René,\n\nOn Fri, 5 Aug 2016, René Scharfe wrote:\n\n> Initialize a string_list right when it's defined.  That's shorter, saves\n> a function call and makes it more obvious that we're using the NODUP\n> variant here.\n\nThank you! I guess I never updated the code after the _INIT* macros were\nintroduced.\n\nThe change is good, of course.\n\nThanks,\nDscho"}]}