From 6e578410960d9ceb35ec98ad4b6fc711f1a9c85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 1 Jan 2023 22:16:48 +0100 Subject: use DUP_ARRAY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- compat/mingw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compat') diff --git a/compat/mingw.c b/compat/mingw.c index e131eb9b07..cd8195ab11 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -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; } -- cgit v1.2.3