public int CompareTo(ScoreTerm other) { if (this.Boost == other.Boost) { return(TermComp.Compare(other.Bytes, this.Bytes)); } else { return(this.Boost.CompareTo(other.Boost)); } }
public int CompareTo(ScoreTerm other) { // LUCENENET specific - compare bits rather than using equality operators to prevent these comparisons from failing in x86 in .NET Framework with optimizations enabled if (NumericUtils.SingleToSortableInt32(this.Boost) == NumericUtils.SingleToSortableInt32(other.Boost)) { return(TermComp.Compare(other.Bytes, this.Bytes)); } else { return(this.Boost.CompareTo(other.Boost)); } }