Re: [PATCH v4 2/4] path: optimize common dir checking
- From
David Turner <dturner@twopensource.com>
- Date
- Aug 26, 2015, 22:10 UTC
- Message-ID
- <1440627031.26055.5.camel@twopensource.com>
- In-Reply-To
- <xmqqwpwh21ky.fsf@gitster.dls.corp.google.com>
On Wed, 2015-08-26 at 14:15 -0700, Junio C Hamano wrote:
Show 10 quoted lines
> > + * For example, consider the following set of strings: > > + * abc > > + * def > > + * definite > > + * definition > > + * > > + * The trie would look look like: > > + * root: len = 0, value = (something), children a and d non-NULL. > > "value = NULL", as there is no empty string registered in the trie?
Indeed.
> > + * a: len = 2, contents = bc > > "value = NULL" here, too (just showing I am following along, not > just skimming)?
Yep.
<snip>
Show 7 quoted lines
> > + /* Partial path normalization: skip consecutive slashes */ > > + while (key[0] == '/' && key[1] == '/') > > + key ++; > > These "skipping consecutive slashes" inside this function is cute. > I would have expected me to react "Eek, Ugly" to it, but somehow I > didn't find them ugly.
It's right on the cute/ugly edge for me too.
<snip>
> I somehow wonder if we'd want to precomute the trie at the build > time, though ;-)
LOL.
<snip>
> Thanks for a pleasant read.
Thank you! I'll re-roll with those last two fixes (re value=NULL) tomorrow-ish.