merge-recursive: use STRING_LIST_INIT_NODUP
Initialize a string_list right when it's defined. That's shorter, saves a function call and makes it more obvious that we're using the NODUP variant here. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Aug 5, 2016 at 22:42 UTC
af4941d444f8bbbc02f68472f4cd6d5846ee043c
1 file changed
+1
-2
merge-recursive.c
+1
-2
@@ -400,7 +400,7 @@ static void record_df_conflict_files(struct merge_options *o,
400
* and the file need to be present, then the D/F file will be
401
* reinstated with a new unique name at the time it is processed.
402
*/
403
- struct string_list df_sorted_entries;
403
+ struct string_list df_sorted_entries = STRING_LIST_INIT_NODUP;
404
const char *last_file = NULL;
405
int last_len = 0;
406
int i;
@@ -413,7 +413,6 @@ static void record_df_conflict_files(struct merge_options *o,
413
return;
414
415
/* Ensure D/F conflicts are adjacent in the entries list. */
416
- memset(&df_sorted_entries, 0, sizeof(struct string_list));
416
for (i = 0; i < entries->nr; i++) {
417
struct string_list_item *next = &entries->items[i];
418
string_list_append(&df_sorted_entries, next->string)->util =