Lucene.Net.Core.Search.Spans (SpanFirstQuery + SpanNearPayloadCheckQuery + 
SpanNearQuery + SpanOrQuery + SpanPayloadCheckQuery + SpanPositionRangeQuery): 
Changed GetHashCode() implementation to call SingleToRawInt32Bits() rather than 
SingleToInt32Bits() (as was done in Lucene)


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/dd574f77
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/dd574f77
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/dd574f77

Branch: refs/heads/api-work
Commit: dd574f772d3f5ca3c3d4b75060a895e771fb5287
Parents: 9a501d7
Author: Shad Storhaug <[email protected]>
Authored: Wed Mar 1 23:49:25 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Thu Mar 2 08:08:49 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/Spans/SpanFirstQuery.cs            | 2 +-
 src/Lucene.Net.Core/Search/Spans/SpanNearPayloadCheckQuery.cs | 2 +-
 src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs             | 2 +-
 src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs               | 2 +-
 src/Lucene.Net.Core/Search/Spans/SpanPayloadCheckQuery.cs     | 2 +-
 src/Lucene.Net.Core/Search/Spans/SpanPositionRangeQuery.cs    | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd574f77/src/Lucene.Net.Core/Search/Spans/SpanFirstQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanFirstQuery.cs 
b/src/Lucene.Net.Core/Search/Spans/SpanFirstQuery.cs
index 93d0d93..0d0dd77 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanFirstQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanFirstQuery.cs
@@ -98,7 +98,7 @@ namespace Lucene.Net.Search.Spans
         {
             int h = m_match.GetHashCode();
             h ^= (h << 8) | ((int)((uint)h >> 25)); // reversible
-            h ^= Number.SingleToInt32Bits(Boost) ^ m_end; // LUCENENET TODO: 
This was FloatToRawIntBits in the original
+            h ^= Number.SingleToRawInt32Bits(Boost) ^ m_end;
             return h;
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd574f77/src/Lucene.Net.Core/Search/Spans/SpanNearPayloadCheckQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanNearPayloadCheckQuery.cs 
b/src/Lucene.Net.Core/Search/Spans/SpanNearPayloadCheckQuery.cs
index 411daa9..27af667 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanNearPayloadCheckQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanNearPayloadCheckQuery.cs
@@ -126,7 +126,7 @@ namespace Lucene.Net.Search.Spans
             h ^= (h << 8) | ((int)((uint)h >> 25)); // reversible
             //TODO: is this right?
             h ^= m_payloadToMatch.GetHashCode();
-            h ^= Number.SingleToInt32Bits(Boost); // LUCENENET TODO: This was 
FloatToRawIntBits in the original
+            h ^= Number.SingleToRawInt32Bits(Boost);
             return h;
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd574f77/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs 
b/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs
index 541b3e3..d6fba02 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs
@@ -243,7 +243,7 @@ namespace Lucene.Net.Search.Spans
             // last element of clauses.  this particular mix also serves to
             // differentiate SpanNearQuery hashcodes from others.
             result ^= (result << 14) | ((int)((uint)result >> 19)); // 
reversible
-            result += Number.SingleToInt32Bits(Boost); // LUCENENET TODO: This 
was FloatToRawIntBits in the original
+            result += Number.SingleToRawInt32Bits(Boost);
             result += m_slop;
             result ^= (m_inOrder ? unchecked((int)0x99AFD3BD) : 0);
             return result;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd574f77/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs 
b/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
index 29f2c5e..5e1e005 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
@@ -170,7 +170,7 @@ namespace Lucene.Net.Search.Spans
             //If this doesn't work, hash all elemnts together instead. This 
version was used to reduce time complexity
             int h = clauses.Count == 0 ? 0 : 
HashHelpers.CombineHashCodes(clauses.First().GetHashCode(), 
clauses.Last().GetHashCode(), clauses.Count);
             h ^= (h << 10) | ((int)(((uint)h) >> 23));
-            h ^= Number.SingleToInt32Bits(Boost);
+            h ^= Number.SingleToRawInt32Bits(Boost);
             return h;
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd574f77/src/Lucene.Net.Core/Search/Spans/SpanPayloadCheckQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanPayloadCheckQuery.cs 
b/src/Lucene.Net.Core/Search/Spans/SpanPayloadCheckQuery.cs
index 12f61da..575f66f 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanPayloadCheckQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanPayloadCheckQuery.cs
@@ -126,7 +126,7 @@ namespace Lucene.Net.Search.Spans
             h ^= (h << 8) | ((int)((uint)h >> 25)); // reversible
             //TODO: is this right?
             h ^= m_payloadToMatch.GetHashCode();
-            h ^= Number.SingleToInt32Bits(Boost); // LUCENENET TODO: This was 
FloatToRawIntBits in the original
+            h ^= Number.SingleToRawInt32Bits(Boost);
             return h;
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd574f77/src/Lucene.Net.Core/Search/Spans/SpanPositionRangeQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanPositionRangeQuery.cs 
b/src/Lucene.Net.Core/Search/Spans/SpanPositionRangeQuery.cs
index b8c5ae0..b6056d5 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanPositionRangeQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanPositionRangeQuery.cs
@@ -112,7 +112,7 @@ namespace Lucene.Net.Search.Spans
         {
             int h = m_match.GetHashCode();
             h ^= (h << 8) | ((int)((uint)h >> 25)); // reversible
-            h ^= Number.SingleToInt32Bits(Boost) ^ m_end ^ m_start; // 
LUCENENET TODO: This was FloatToRawIntBits in the original
+            h ^= Number.SingleToRawInt32Bits(Boost) ^ m_end ^ m_start;
             return h;
         }
     }

Reply via email to