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>
This commit is contained in:

committed by
Junio C Hamano

parent
d2ec87a684
commit
6e57841096
@ -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,
|
||||
|
Reference in New Issue
Block a user