summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-01-01 21:16:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-01-09 04:28:36 (GMT)
commit6e578410960d9ceb35ec98ad4b6fc711f1a9c85c (patch)
treeeda5b7fabcc2394e6b9b3f021d8e03a0833273fe /builtin
parentd2ec87a684e2f9cd1f0c653620a00d74ad5ee2ce (diff)
downloadgit-6e578410960d9ceb35ec98ad4b6fc711f1a9c85c.zip
git-6e578410960d9ceb35ec98ad4b6fc711f1a9c85c.tar.gz
git-6e578410960d9ceb35ec98ad4b6fc711f1a9c85c.tar.bz2
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 'builtin')
-rw-r--r--builtin/am.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/am.c b/builtin/am.c
index dddf1b9..eee06bb 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1489,8 +1489,7 @@ static int run_apply(const struct am_state *state, const char *index_file)
* apply_opts.v keeps referencing the allocated strings for
* strvec_clear() to release.
*/
- ALLOC_ARRAY(apply_argv, apply_opts.nr);
- COPY_ARRAY(apply_argv, apply_opts.v, apply_opts.nr);
+ DUP_ARRAY(apply_argv, apply_opts.v, apply_opts.nr);
opts_left = apply_parse_options(apply_opts.nr, apply_argv,
&apply_state, &force_apply, &options,