You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2010/12/06 17:59:17 UTC

svn commit: r1042721 - /lucene/dev/trunk/solr/src/java/org/apache/solr/search/MutableValueInt.java

Author: yonik
Date: Mon Dec  6 16:59:16 2010
New Revision: 1042721

URL: http://svn.apache.org/viewvc?rev=1042721&view=rev
Log:
fix mutable int comparator

Modified:
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/MutableValueInt.java

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/MutableValueInt.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/MutableValueInt.java?rev=1042721&r1=1042720&r2=1042721&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/MutableValueInt.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/MutableValueInt.java Mon Dec  6 16:59:16 2010
@@ -50,14 +50,8 @@ public class MutableValueInt extends Mut
     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;