Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-01-02 00:16:48 +0300
committerJunio C Hamano <gitster@pobox.com>2023-01-09 07:28:36 +0300
commit6e578410960d9ceb35ec98ad4b6fc711f1a9c85c (patch)
treeeda5b7fabcc2394e6b9b3f021d8e03a0833273fe /attr.c
parentd2ec87a684e2f9cd1f0c653620a00d74ad5ee2ce (diff)
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>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c3
1 files changed, 1 insertions, 2 deletions
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;
}