]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: simplify allocation of result array in todo_list_rearrange_squash()
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Wed, 9 Aug 2023 17:15:32 +0000 (19:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Aug 2023 20:52:11 +0000 (13:52 -0700)
commit82dc42cbd1c4576c2fd879996d9e73a86434769a
tree436021cb5e3d14ae044207855b7f8c1dabe54f6a
parenta82fb66fed250e16d3010c75404503bea3f0ab61
sequencer: simplify allocation of result array in todo_list_rearrange_squash()

The operation doesn't change the number of elements in the array, so we do
not need to allocate the result piecewise.

This moves the re-assignment of todo_list->alloc at the end slighly up,
so it's right after the newly added assert which also refers to `nr`
(and which indeed should come first). Also, the value is more likely to
be still in a register at that point.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c