Skip to content

Commit af4941d

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 08df31e commit af4941d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

merge-recursive.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static void record_df_conflict_files(struct merge_options *o,
400400
* and the file need to be present, then the D/F file will be
401401
* reinstated with a new unique name at the time it is processed.
402402
*/
403-
struct string_list df_sorted_entries;
403+
struct string_list df_sorted_entries = STRING_LIST_INIT_NODUP;
404404
const char *last_file = NULL;
405405
int last_len = 0;
406406
int i;
@@ -413,7 +413,6 @@ static void record_df_conflict_files(struct merge_options *o,
413413
return;
414414

415415
/* Ensure D/F conflicts are adjacent in the entries list. */
416-
memset(&df_sorted_entries, 0, sizeof(struct string_list));
417416
for (i = 0; i < entries->nr; i++) {
418417
struct string_list_item *next = &entries->items[i];
419418
string_list_append(&df_sorted_entries, next->string)->util =

0 commit comments

Comments
 (0)