Re: [PATCH 1/3] commit-reach: use one walk in remove_redundant()
- From
René Scharfe <l.s.r@web.de>
- Date
- Jan 29, 2021, 17:10 UTC
- Message-ID
- <d1c7b530-f1ef-8aee-32d3-6ac6707bad37@web.de>
- In-Reply-To
- <3fe74e339fc5b7083398f2df51baae5a4a008060.1611851095.git.gitgitgadget@gmail.com>
Am 28.01.21 um 17:24 schrieb Derrick Stolee via GitGitGadget:
> + /* rearrange array */ > + dup = xcalloc(cnt, sizeof(struct commit *));
You could use CALLOC_ARRAY instead here, which is shorter and uses the correct type automatically. Or -- seeing that the next line overwrites all items anyway -- ALLOC_ARRAY.
> + COPY_ARRAY(dup, array, cnt);
René