use DUP_ARRAY
Add a semantic patch for replace ALLOC_ARRAY+COPY_ARRAY with DUP_ARRAY to reduce code duplication and apply its results. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d2ec87a684
commit
6e57841096
@ -1396,8 +1396,7 @@ static wchar_t *make_environment_block(char **deltaenv)
|
||||
p += s;
|
||||
}
|
||||
|
||||
ALLOC_ARRAY(result, size);
|
||||
COPY_ARRAY(result, wenv, size);
|
||||
DUP_ARRAY(result, wenv, size);
|
||||
FreeEnvironmentStringsW(wenv);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user