Browse Source
Instead of creating a new allocation, reverse the original list in-place by calling the reverse_commit_list() helper. The original code discards the list "bases" after storing its reverse copy in a newly created list "reversed". If the code that followed from here used both "bases" and "reversed", the modification would not have worked, but since the original list "bases" gets discarded, we can simply reverse "bases" in-place with the reverse_commit_list() helper and reuse the same variable in the code that follows. builtin/merge.c has been left unmodified, since in its case, the original list is needed separately from its reverse copy by the code. Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint


1 changed files with 4 additions and 6 deletions
Loading…
Reference in new issue