merge-ort: make clear_internal_opts() aware of partial clearing
commit43e9c4eeccc069dbe6ca8a65dc5d0093b46acc03
authorElijah Newren <newren@gmail.com>
Wed, 16 Dec 2020 22:28:01 +0000 (16 22:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Dec 2020 05:56:39 +0000 (16 21:56 -0800)
tree6bc2f73f50f8858d2db01a3f49834a21e5e3914f
parent4296d8f17d45465c9712fab099a1a6787a8e9913
merge-ort: make clear_internal_opts() aware of partial clearing

In order to handle recursive merges, after merging merge-bases we need
to clear away most of the data we had built up but some of it needs to
be kept -- in particular the "output" field.  Rename the function to
reflect its future change in use.

Further, since "reinitialize" means we'll be reusing the fields
immediately, take advantage of this to only partially clear maps,
leaving the hashtable allocated and pre-sized.  (This may be slightly
out-of-order since the speedups aren't realized until there are far
more strmaps in use, but the patch submission process already went out
of order because of various questions and requests for strmap.  Anyway,
see commit 6ccdfc2a20 ("strmap: enable faster clearing and reusing of
strmaps", 2020-11-05), for performance details about the use of
strmap_partial_clear().)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c