diff.c: use diff_free_queue()
commit586d8b5052f6b98c262c872f54216e39f3d56625
authorSZEDER Gábor <szeder.dev@gmail.com>
Wed, 2 Nov 2022 22:01:42 +0000 (2 23:01 +0100)
committerTaylor Blau <me@ttaylorr.com>
Thu, 3 Nov 2022 00:16:34 +0000 (2 20:16 -0400)
tree0753446283aeb4af3dff299127742becb632d759
parentef84222fa9b3ed163bacd6dc59a1d855dfbfbd75
diff.c: use diff_free_queue()

Use diff_free_queue() instead of open-coding it.  This shortens the
code and make it less repetitive.

Note that the second hunk in diff_flush() is interesting, because the
'free_queue' label separates the loop freeing the queue's filepairs
from free()-ing the queue's internal array.  This is somewhat
suspicious, but it was not an issue before: there is only one place
from where we jump to this label with a goto, and that is protected by
an 'if (!q->nr && ...)' condition, i.e. we only skipped the loop
freeing the filepairs when there were no filepairs in the queue to
begin with.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
diff.c