aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-03-09 14:38:35 -0800
committerShawn O. Pearce <spearce@spearce.org>2011-03-09 16:55:09 -0800
commitdf7b192e264fb985765c28efe4beb3ade8a6b16f (patch)
tree80af4f174d8938ec6aaf82804d53c2d738fd724c /org.eclipse.jgit/src/org/eclipse/jgit/lib
parent16350bf9e41118425c70832f5b9127de6aebfdea (diff)
downloadjgit-df7b192e264fb985765c28efe4beb3ade8a6b16f.tar.gz
jgit-df7b192e264fb985765c28efe4beb3ade8a6b16f.zip
ObjectIdSubclassMap: Manually inline index()
This method is trivial in definition, and is called in only 3 places. Inline the method manually to ensure its really going to be inlined by the JIT at runtime. Change-Id: I128522af8167c07d2de6cc210573599038871dda Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java10
1 files changed, 3 insertions, 7 deletions
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 ee76a42807..d904eeffdc 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 class ObjectIdSubclassMap<V extends ObjectId> implements Iterable<V> {
* @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 class ObjectIdSubclassMap<V extends ObjectId> implements Iterable<V> {
* type of instance to store.
*/
public <Q extends V> 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 class ObjectIdSubclassMap<V extends ObjectId> implements Iterable<V> {
};
}
- 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;