lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [18/20] lucenenet git commit: Lucene.Net.Replicator.RevisionFile: Corrected GetHashCode() logic
Date Fri, 18 Aug 2017 08:05:05 GMT
Lucene.Net.Replicator.RevisionFile: Corrected GetHashCode() logic


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

Branch: refs/heads/replicator
Commit: e83f40fc6a2a118ba3633249c31e1a5edffd6d81
Parents: 6469c62
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu Aug 17 07:59:50 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Aug 17 07:59:50 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Replicator/RevisionFile.cs | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e83f40fc/src/Lucene.Net.Replicator/RevisionFile.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Replicator/RevisionFile.cs b/src/Lucene.Net.Replicator/RevisionFile.cs
index 0fa897f..139ac23 100644
--- a/src/Lucene.Net.Replicator/RevisionFile.cs
+++ b/src/Lucene.Net.Replicator/RevisionFile.cs
@@ -69,10 +69,7 @@ namespace Lucene.Net.Replicator
 
         public override int GetHashCode()
         {
-            unchecked // LUCENENET TODO: Correct hash code logic
-            {
-                return (FileName.GetHashCode() * 397) ^ Length.GetHashCode();
-            }
+            return FileName.GetHashCode() ^ (int)(Length ^ (long)((ulong)Length >>
32));
         }
 
         public override string ToString()


Mime
View raw message