You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2015/01/07 02:23:10 UTC

[3/3] lucenenet git commit: Minor

Minor


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

Branch: refs/heads/master
Commit: a9585694a7968148f9910c65e3c89cd3b5aae5d4
Parents: c9426e7
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Wed Jan 7 03:22:58 2015 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Wed Jan 7 03:22:58 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Bits.cs        | 42 +++++++++++++++++-----------
 src/Lucene.Net.Core/Util/FixedBitSet.cs |  2 +-
 2 files changed, 26 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a9585694/src/Lucene.Net.Core/Util/Bits.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Bits.cs b/src/Lucene.Net.Core/Util/Bits.cs
index 0e9effd..ac60e78 100644
--- a/src/Lucene.Net.Core/Util/Bits.cs
+++ b/src/Lucene.Net.Core/Util/Bits.cs
@@ -21,11 +21,11 @@ namespace Lucene.Net.Util
     /// Interface for Bitset-like structures.
     /// @lucene.experimental
     /// </summary>
-
     public interface Bits
     {
         /// <summary>
-        /// Returns the value of the bit with the specified <code>index</code>. </summary>
+        /// Returns the value of the bit with the specified <code>index</code>.
+        /// </summary>
         /// <param name="index"> index, should be non-negative and &lt; <seealso cref="#length()"/>.
         ///        The result of passing negative or out of bounds values is undefined
         ///        by this interface, <b>just don't do it!</b> </param>
@@ -35,28 +35,23 @@ namespace Lucene.Net.Util
         /// <summary>
         /// Returns the number of bits in this set </summary>
         int Length();
-
-        /// <summary>
-        /// Bits impl of the specified length with all bits set.
-        /// </summary>
-
-        /// <summary>
-        /// Bits impl of the specified length with no bits set.
-        /// </summary>
     }
 
-    public static class Bits_Fields
+    public static class BitsHelpers
     {
         public static readonly Bits[] EMPTY_ARRAY = new Bits[0];
     }
 
+    /// <summary>
+    /// Bits impl of the specified length with all bits set.
+    /// </summary>
     public class Bits_MatchAllBits : Bits
     {
-        internal readonly int Len;
+        private readonly int _len;
 
         public Bits_MatchAllBits(int len)
         {
-            this.Len = len;
+            _len = len;
         }
 
         public bool Get(int index)
@@ -66,17 +61,25 @@ namespace Lucene.Net.Util
 
         public int Length()
         {
-            return Len;
+            return _len;
+        }
+
+        public override int GetHashCode()
+        {
+            return ("MatchAllBits" + _len).GetHashCode();
         }
     }
 
+    /// <summary>
+    /// Bits impl of the specified length with no bits set.
+    /// </summary>
     public class Bits_MatchNoBits : Bits
     {
-        internal readonly int Len;
+        private readonly int _len;
 
         public Bits_MatchNoBits(int len)
         {
-            this.Len = len;
+            _len = len;
         }
 
         public bool Get(int index)
@@ -86,7 +89,12 @@ namespace Lucene.Net.Util
 
         public int Length()
         {
-            return Len;
+            return _len;
+        }
+
+        public override int GetHashCode()
+        {
+            return ("MatchNoBits" + _len).GetHashCode();
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a9585694/src/Lucene.Net.Core/Util/FixedBitSet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/FixedBitSet.cs b/src/Lucene.Net.Core/Util/FixedBitSet.cs
index 1a5e253..99858af 100644
--- a/src/Lucene.Net.Core/Util/FixedBitSet.cs
+++ b/src/Lucene.Net.Core/Util/FixedBitSet.cs
@@ -718,7 +718,7 @@ namespace Lucene.Net.Util
             {
                 return false;
             }
-            FixedBitSet other = (FixedBitSet)o;
+            var other = (FixedBitSet)o;
             if (NumBits != other.Length())
             {
                 return false;