mirror of https://github.com/apache/lucene.git
improve hashcodes: LUCENE-460
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@358693 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
99c9289a89
commit
75c81da538
|
@ -155,9 +155,13 @@ public class RangeQuery extends Query
|
|||
|
||||
/** Returns a hash code value for this object.*/
|
||||
public int hashCode() {
|
||||
return Float.floatToIntBits(getBoost()) ^
|
||||
(lowerTerm != null ? lowerTerm.hashCode() : 0) ^
|
||||
(upperTerm != null ? upperTerm.hashCode() : 0) ^
|
||||
(this.inclusive ? 1 : 0);
|
||||
int h = Float.floatToIntBits(getBoost());
|
||||
h ^= lowerTerm != null ? lowerTerm.hashCode() : 0;
|
||||
// reversible mix to make lower and upper position dependent and
|
||||
// to prevent them from cancelling out.
|
||||
h ^= (h << 25) | (h >>> 8);
|
||||
h ^= upperTerm != null ? upperTerm.hashCode() : 0;
|
||||
h ^= this.inclusive ? 0x2742E74A : 0;
|
||||
return h;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue