]> source.dussan.org Git - jgit.git/commit
Move cached element hash codes to HashedSequence 85/1585/2
authorShawn O. Pearce <spearce@spearce.org>
Sat, 11 Sep 2010 00:48:24 +0000 (17:48 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 21 Sep 2010 01:15:21 +0000 (18:15 -0700)
commitbaaddd51f1ffcda73640579af47983da8f7ce5f9
tree32d1fc5fae1f295806034de807cb39cc34c95d84
parente0970cd1b4d10888fc73ea903b2f6a62be6b0225
Move cached element hash codes to HashedSequence

Most diff implementations really want to use cached hash codes for
elements, rather than element equality, as they need to perform many
compares and unique hash codes for elements can really speed that
process up.

To make it easier to define element hash functions, move the caching
of hash codes into a wrapper sequence type, so that individual
sequence types like RawText don't need to do this themselves.  This
has a nice property of also allowing the sequence to no longer care
about the specific SequenceComparator that is going to be used, and
permits the caching to only examine the middle region that isn't
common to the two inputs.

Change-Id: If8623556da9419117b07c5073e8bce39de02570e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequence.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequenceComparator.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextComparator.java