diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java index ee76a4280..d904eeffd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java @@ -92,7 +92,7 @@ public void clear() { * @return the instance mapped to toFind, or null if no mapping exists. */ public V get(final AnyObjectId toFind) { - int i = index(toFind); + int i = toFind.w1 & mask; V obj; while ((obj = table[i]) != null) { @@ -155,7 +155,7 @@ public void add(final Q newValue) { * type of instance to store. */ public V addIfAbsent(final Q newValue) { - int i = index(newValue); + int i = newValue.w1 & mask; V obj; while ((obj = table[i]) != null) { @@ -213,12 +213,8 @@ public void remove() { }; } - private final int index(final AnyObjectId id) { - return id.w1 & mask; - } - private void insert(final V newValue) { - int j = index(newValue); + int j = newValue.w1 & mask; while (table[j] != null) { if (++j >= table.length) j = 0;