Re: [PATCH v2] merge-recursive: change current file dir string_lists to hashmap
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 6, 2017, 23:44 UTC
- Message-ID
- <xmqqmv672xzb.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170906222834.77116-1-kewillf@microsoft.com>
Kevin Willford <kewillf@microsoft.com> writes:
Show 26 quoted lines
> The code was using two string_lists, one for the directories and
> one for the files. The code never checks the lists independently
> so we should be able to only use one list. The string_list also
> is a O(log n) for lookup and insertion. Switching this to use a
> hashmap will give O(1) which will save some time when there are
> millions of paths that will be checked.
>
> Also cleaned up a memory leak and method where the return was not
> being used.
>
> Signed-off-by: Kevin Willford <kewillf@microsoft.com>
> ---
> merge-recursive.c | 76 ++++++++++++++++++++++++++++++++++++++++---------------
> merge-recursive.h | 3 +--
> 2 files changed, 57 insertions(+), 22 deletions(-)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 1494ffdb82..ebfe01017f 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -24,6 +24,31 @@
> #include "dir.h"
> #include "submodule.h"
>
> +struct path_hashmap_entry {
> + struct hashmap_entry;You seem to have lost the squash you privately agreed to that is needed in order to make it compile?