lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r836031 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net/Search: BooleanQuery.cs Query.cs
Date Fri, 13 Nov 2009 22:24:50 GMT
Author: aroush
Date: Fri Nov 13 22:24:50 2009
New Revision: 836031

URL: http://svn.apache.org/viewvc?rev=836031&view=rev
Log:
Fixed NUnit test-cases for: TestBoolean2

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/BooleanQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/BooleanQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/BooleanQuery.cs?rev=836031&r1=836030&r2=836031&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/BooleanQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/BooleanQuery.cs Fri Nov 13 22:24:50
2009
@@ -308,7 +308,9 @@
 				int shouldMatchCount = 0;
 				for (System.Collections.IEnumerator wIter = weights.GetEnumerator(), cIter = Enclosing_Instance.clauses.GetEnumerator();
wIter.MoveNext(); )
 				{
-					Weight w = (Weight) wIter.Current;
+                    cIter.MoveNext();
+
+                    Weight w = (Weight)wIter.Current;
 					BooleanClause c = (BooleanClause) cIter.Current;
 					if (w.Scorer(reader, true, true) == null)
 					{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Query.cs?rev=836031&r1=836030&r2=836031&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs Fri Nov 13 22:24:50 2009
@@ -164,14 +164,16 @@
 			// optimization: if we have just one query, just return it
 			if (uniques.Count == 1)
 			{
-				return (Query) uniques.GetEnumerator().Current;
+                foreach (object key in uniques.Keys)
+                {
+                    return (Query) key;
+                }
 			}
-			System.Collections.IEnumerator it = uniques.GetEnumerator();
 			BooleanQuery result = new BooleanQuery(true);
-			while (it.MoveNext())
-			{
-				result.Add((Query) it.Current, BooleanClause.Occur.SHOULD);
-			}
+            foreach (object key in uniques.Keys)
+            {
+                result.Add((Query) key, BooleanClause.Occur.SHOULD);
+            }
 			return result;
 		}
 		



Mime
View raw message