lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Fix bitset tests
Date Fri, 16 Jan 2015 14:12:40 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 3ecdbb107 -> bf3030297


Fix bitset tests


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

Branch: refs/heads/master
Commit: bf3030297c90856ee451724f904f043bdbb45120
Parents: 3ecdbb1
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Fri Jan 16 16:12:21 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Fri Jan 16 16:12:21 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/BitSetSupport.cs     | 6 +++---
 src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bf303029/src/Lucene.Net.Core/Support/BitSetSupport.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/BitSetSupport.cs b/src/Lucene.Net.Core/Support/BitSetSupport.cs
index 471a216..8c66cac 100644
--- a/src/Lucene.Net.Core/Support/BitSetSupport.cs
+++ b/src/Lucene.Net.Core/Support/BitSetSupport.cs
@@ -70,11 +70,11 @@ namespace Lucene.Net.Support
         public static BitArray And_UnequalLengths(this BitArray bitsA, BitArray bitsB)
         {
             //Cycle only through fewest bits neccessary without requiring size equality
-            int maxIdx = Math.Min(bitsA.Length, bitsB.Length);//exclusive
-            BitArray bits = new BitArray(maxIdx);
+            var maxIdx = Math.Min(bitsA.Length, bitsB.Length);//exclusive
+            var bits = new BitArray(maxIdx);
             for (int i = 0; i < maxIdx; i++)
             {
-                bitsA[i] = bitsA[i] & bitsB[i];
+                bits[i] = bitsA[i] & bitsB[i];
             }
             return bits;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bf303029/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs b/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
index 7eab97d..9dcb7dd 100644
--- a/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
@@ -169,13 +169,13 @@ namespace Lucene.Net.Util
                     Assert.AreEqual(a.Cardinality(), b.Cardinality());
 
                     BitArray a_and = (BitArray)a.Clone();
-                    a_and = a_and.And(a0);
+                    a_and = a_and.And_UnequalLengths(a0);
                     BitArray a_or = (BitArray)a.Clone();
-                    a_or = a_or.Or(a0);
+                    a_or = a_or.Or_UnequalLengths(a0);
                     BitArray a_xor = (BitArray)a.Clone();
-                    a_xor = a_xor.Xor(a0);
+                    a_xor = a_xor.Xor_UnequalLengths(a0);
                     BitArray a_andn = (BitArray)a.Clone();
-                    a_andn.AndNot(a0);
+                    a_andn.And_UnequalLengths(a0);
 
                     LongBitSet b_and = b.Clone();
                     Assert.AreEqual(b, b_and);


Mime
View raw message