Skip to content

Apache Lucene open-source search software

fix mutable int comparator

Yonik Seeley29ebc9f9b0b7
diff --git a/solr/src/java/org/apache/solr/search/MutableValueInt.java b/solr/src/java/org/apache/solr/search/MutableValueInt.java
index 0a6838e055a..1502b1345b0 100755
--- a/solr/src/java/org/apache/solr/search/MutableValueInt.java
+++ b/solr/src/java/org/apache/solr/search/MutableValueInt.java
@@ -50,14 +50,8 @@ public class MutableValueInt extends MutableValue {
MutableValueInt b = (MutableValueInt)other;
int ai = value;
int bi = b.value;
- int c = (int)((((long)ai) - ((long)bi)) >> 32); // any shift >= 32 should do.
- if (c!=0) return c;
- /* is there any pattern that the compiler would recognize as a single native CMP instruction? */
- /***
- if (a<b) return -1;
- else if (a>b) return 1;
- else return 0;
- ***/
+ if (ai<bi) return -1;
+ else if (ai>bi) return 1;
if (exists == b.exists) return 0;
return exists ? 1 : -1;