lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [21/50] lucenenet git commit: BUG: Lucene.Net.Core.Util.FieldCacheSanityChecker: Corrected behavior to use RuntimeHelpers.GetHashCode() to get the identity hash code of val
Date Thu, 30 Mar 2017 18:00:16 GMT
BUG: Lucene.Net.Core.Util.FieldCacheSanityChecker: Corrected behavior to use RuntimeHelpers.GetHashCode()
to get the identity hash code of val


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

Branch: refs/heads/api-work
Commit: d747e7a4d01c7a8ce8686b1c76478209b2707ca6
Parents: a701b99
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu Mar 30 08:17:43 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Mar 30 09:12:32 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d747e7a4/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs b/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
index 9d3d6f4..f42d53a 100644
--- a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
+++ b/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
@@ -144,7 +144,7 @@ namespace Lucene.Net.Util
 
                 ReaderField rf = new ReaderField(item.ReaderKey, item.FieldName);
 
-                int valId = val.GetHashCode();
+                int valId = RuntimeHelpers.GetHashCode(val);
 
                 // indirect mapping, so the MapOfSet will dedup identical valIds for us
                 valIdToItems.Put(valId, item);
@@ -348,7 +348,8 @@ namespace Lucene.Net.Util
                 }
 
                 ReaderField other = (ReaderField)that;
-                return (this.readerKey == other.readerKey && this.FieldName.Equals(other.FieldName,
StringComparison.Ordinal));
+                return (object.ReferenceEquals(this.readerKey, other.readerKey) 
+                    && this.FieldName.Equals(other.FieldName, StringComparison.Ordinal));
             }
 
             public override string ToString()


Mime
View raw message