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 --- attr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'attr.c') diff --git a/attr.c b/attr.c index 42ad6de8c7..e4e304a826 100644 --- a/attr.c +++ b/attr.c @@ -599,8 +599,7 @@ struct attr_check *attr_check_dup(const struct attr_check *check) ret->nr = check->nr; ret->alloc = check->alloc; - ALLOC_ARRAY(ret->items, ret->nr); - COPY_ARRAY(ret->items, check->items, ret->nr); + DUP_ARRAY(ret->items, check->items, ret->nr); return ret; } -- cgit v1.2.3