mirror of https://github.com/apache/lucene.git
SOLR-264: equivalent logic without branch
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@548599 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
59ed1b5bf1
commit
c06888092b
|
@ -58,7 +58,7 @@ public class RandomSortField extends FieldType
|
|||
final Random rand = new Random();
|
||||
|
||||
public int compare (ScoreDoc i, ScoreDoc j) {
|
||||
return (rand.nextBoolean()) ? 1 : -1; //rand.nextInt() >>> 31; ??
|
||||
return (rand.nextInt() & 0x2) - 1; // (rand.nextBoolean()) ? 1 : -1;
|
||||
}
|
||||
public Comparable sortValue (ScoreDoc i) {
|
||||
return new Float(rand.nextFloat());
|
||||
|
|
Loading…
Reference in New Issue