From: Kevin Willford <kewillf@microsoft.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, Kevin Willford <kewillf@microsoft.com>
Subject: [PATCH v3 0/3] merge-recursive: replace string_list with hashmap
Date: Thu, 7 Sep 2017 10:25:53 -0600 [thread overview]
Message-ID: <20170907162556.61384-1-kewillf@microsoft.com> (raw)
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.
Changes since last version:
1. Removed the function pointers and just check the ignore_case in the
compare and hash methods.
2. Added a comment about the hashmap and why it is getting initialized
and freed but not a local.
3. Use hashmap_get_from_hash and remove the dummy entry
Kevin Willford (3):
merge-recursive: fix memory leak
merge-recursive: remove return value from get_files_dirs
merge-recursive: change current file dir string_lists to hashmap
merge-recursive.c | 76 ++++++++++++++++++++++++++++++++++++++++---------------
merge-recursive.h | 3 +--
2 files changed, 57 insertions(+), 22 deletions(-)
--
2.14.1.329.gcdd497e120.dirty
next reply other threads:[~2017-09-07 16:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 16:25 Kevin Willford [this message]
2017-09-07 16:25 ` [PATCH v3 1/3] merge-recursive: fix memory leak Kevin Willford
2017-09-07 16:25 ` [PATCH v3 2/3] merge-recursive: remove return value from get_files_dirs Kevin Willford
2017-09-07 16:25 ` [PATCH v3 3/3] merge-recursive: change current file dir string_lists to hashmap Kevin Willford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170907162556.61384-1-kewillf@microsoft.com \
--to=kewillf@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.