Micro-optimize the combineDF part of NameConflictTreeWalk
commit10ff298ad91032c753c599fdc9cd1a5dbe2df4f2
authorShawn O. Pearce <spearce@spearce.org>
Tue, 19 Aug 2008 23:17:13 +0000 (19 16:17 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 20 Aug 2008 21:08:20 +0000 (20 23:08 +0200)
treeef1b4e7264f754ed5c02252b78b4bc6f478bdedc
parenta508948a92cd608453369b05214144a327f0357d
Micro-optimize the combineDF part of NameConflictTreeWalk

We can do the common case of combineDF (which requires no lookahead)
during the search for the minimum entry by keeping track of the type
of each entry and using the single entry lookahead inherent in the
data structure.

Since this catches the most common case of "a" and "a/" with no
intervening "a.foo" we can typically avoid the much more costly
combineDF and skipEntry routines.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/treewalk/NameConflictTreeWalk.java