]> source.dussan.org Git - jgit.git/commit
Reduce compares in Edit.getType 11/1511/2
authorShawn O. Pearce <spearce@spearce.org>
Thu, 2 Sep 2010 20:07:23 +0000 (13:07 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 4 Sep 2010 06:55:46 +0000 (23:55 -0700)
commit6938f99ef3338ec51b528800caf561dad30d9cec
treebd9292a72cb32474fec1f81e28a574809bbc8a1f
parentfe8fe13349bb46ae690cfea6d3e57bfdac2301e4
Reduce compares in Edit.getType

We can slightly optimize this method by removing some compares
based on knowledge of how the orderings have to work.  This way
a getType() invocation requires at most 2 int compares for any
result, vs. the 6 required to find REPLACE before.

Change-Id: I62a04cc513a6d28c300d1c1496a8608d5df4efa6
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java