lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/2] lucenenet git commit: use BitArray SafeSet extension to mimic Java behavior
Date Wed, 31 Dec 2014 20:32:02 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 7bcff5395 -> 355f09dad


use BitArray SafeSet extension to mimic Java behavior


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

Branch: refs/heads/master
Commit: 0675408a38af8390eadab5ca65dc25cd061dbc56
Parents: 7bcff53
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Wed Dec 31 15:10:48 2014 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Wed Dec 31 15:10:48 2014 -0500

----------------------------------------------------------------------
 .../Search/SearchEquivalenceTestBase.cs                        | 6 ++++--
 src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs          | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0675408a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
index 2371021..bbcc826 100644
--- a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
@@ -1,7 +1,9 @@
 using System;
 using System.Collections;
+using System.Linq;
 using System.Text;
 using Lucene.Net.Documents;
+using Lucene.Net.Support;
 
 namespace Lucene.Net.Search
 {
@@ -204,10 +206,10 @@ namespace Lucene.Net.Search
             Assert.IsTrue(td1.TotalHits <= td2.TotalHits);
 
             // fill the superset into a bitset
-            BitArray bitset = new BitArray(td2.ScoreDocs.Length);
+            var bitset = new BitArray(td2.ScoreDocs.Length);
             for (int i = 0; i < td2.ScoreDocs.Length; i++)
             {
-                bitset.Set(td2.ScoreDocs[i].Doc, true);
+                bitset.SafeSet(td2.ScoreDocs[i].Doc, true);
             }
 
             // check in the subset, that every bit was set by the super

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0675408a/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs b/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
index 6aeb7fc..09914c9 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Documents;
+using Lucene.Net.Support;
 using Lucene.Net.Util;
 using System;
 using System.Collections;
@@ -526,7 +527,7 @@ namespace Lucene.Net.Search
                 int d;
                 while ((d = termDocsEnum.NextDoc()) != DocsEnum.NO_MORE_DOCS)
                 {
-                    bitSet.Set(d, true);
+                    bitSet.SafeSet(d, true);
                 }
                 return new DocIdSetAnonymousInnerClassHelper(this, nullBitset, reader, bitSet);
             }


Mime
View raw message