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 --- parse-options.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'parse-options.c') diff --git a/parse-options.c b/parse-options.c index a1ec932f0f..fd4743293f 100644 --- a/parse-options.c +++ b/parse-options.c @@ -702,8 +702,7 @@ static struct option *preprocess_options(struct parse_opt_ctx_t *ctx, if (!nr_aliases) return NULL; - ALLOC_ARRAY(newopt, nr + 1); - COPY_ARRAY(newopt, options, nr + 1); + DUP_ARRAY(newopt, options, nr + 1); /* each alias has two string pointers and NULL */ CALLOC_ARRAY(ctx->alias_groups, 3 * (nr_aliases + 1)); -- cgit v1.2.3