1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

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>
This commit is contained in:
René Scharfe 2016-08-05 22:42:12 +02:00 committed by Junio C Hamano
parent 08df31eecc
commit af4941d444

View file

@ -400,7 +400,7 @@ static void record_df_conflict_files(struct merge_options *o,
* and the file need to be present, then the D/F file will be
* reinstated with a new unique name at the time it is processed.
*/
struct string_list df_sorted_entries;
struct string_list df_sorted_entries = STRING_LIST_INIT_NODUP;
const char *last_file = NULL;
int last_len = 0;
int i;
@ -413,7 +413,6 @@ static void record_df_conflict_files(struct merge_options *o,
return;
/* Ensure D/F conflicts are adjacent in the entries list. */
memset(&df_sorted_entries, 0, sizeof(struct string_list));
for (i = 0; i < entries->nr; i++) {
struct string_list_item *next = &entries->items[i];
string_list_append(&df_sorted_entries, next->string)->util =