lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [23/50] lucenenet git commit: Lucene.Net.Core.Util.Packed.EliasFanoEncoder: Formatted the Equals() and GetHashCode() methods the same as in Lucene
Date Thu, 30 Mar 2017 18:00:18 GMT
Lucene.Net.Core.Util.Packed.EliasFanoEncoder: Formatted the Equals() and GetHashCode() methods
the same as in Lucene


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

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

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Packed/EliasFanoEncoder.cs | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c0a9ae6f/src/Lucene.Net.Core/Util/Packed/EliasFanoEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Packed/EliasFanoEncoder.cs b/src/Lucene.Net.Core/Util/Packed/EliasFanoEncoder.cs
index 44f3b2f..1ef3f3f 100644
--- a/src/Lucene.Net.Core/Util/Packed/EliasFanoEncoder.cs
+++ b/src/Lucene.Net.Core/Util/Packed/EliasFanoEncoder.cs
@@ -381,12 +381,20 @@ namespace Lucene.Net.Util.Packed
             }
             EliasFanoEncoder oefs = (EliasFanoEncoder)other;
             // no equality needed for upperBound
-            return (this.numValues == oefs.numValues) && (this.numEncoded == oefs.numEncoded)
&& (this.numLowBits == oefs.numLowBits) && (this.numIndexEntries == oefs.numIndexEntries)
&& (this.indexInterval == oefs.indexInterval) && Arrays.Equals(this.upperLongs,
oefs.upperLongs) && Arrays.Equals(this.lowerLongs, oefs.lowerLongs); // no need to
check index content
+            return (this.numValues == oefs.numValues) 
+                && (this.numEncoded == oefs.numEncoded) 
+                && (this.numLowBits == oefs.numLowBits) 
+                && (this.numIndexEntries == oefs.numIndexEntries) 
+                && (this.indexInterval == oefs.indexInterval) 
+                && Arrays.Equals(this.upperLongs, oefs.upperLongs) 
+                && Arrays.Equals(this.lowerLongs, oefs.lowerLongs); // no need to
check index content
         }
 
         public override int GetHashCode()
         {
-            int h = ((int)(31 * (numValues + 7 * (numEncoded + 5 * (numLowBits + 3 * (numIndexEntries
+ 11 * indexInterval)))))) ^ Arrays.GetHashCode(upperLongs) ^ Arrays.GetHashCode(lowerLongs);
+            int h = ((int)(31 * (numValues + 7 * (numEncoded + 5 * (numLowBits + 3 * (numIndexEntries
+ 11 * indexInterval)))))) 
+                ^ Arrays.GetHashCode(upperLongs) 
+                ^ Arrays.GetHashCode(lowerLongs);
             return h;
         }
     }


Mime
View raw message