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: Query equals check for null, dictionary usage fixes
Date Sat, 27 Dec 2014 17:00:43 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 2221c6e0e -> b688fb355


Query equals check for null, dictionary usage fixes


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

Branch: refs/heads/master
Commit: c9caf7c348f39625a4e7817bce46ccb0ff6fa835
Parents: 2221c6e
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Fri Dec 26 20:19:10 2014 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Fri Dec 26 20:19:10 2014 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Index/LogMergePolicy.cs             | 2 +-
 src/Lucene.Net.Core/Search/Query.cs                     | 7 ++++---
 src/Lucene.Net.Tests/core/Search/TestLiveFieldValues.cs | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c9caf7c3/src/Lucene.Net.Core/Index/LogMergePolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/LogMergePolicy.cs b/src/Lucene.Net.Core/Index/LogMergePolicy.cs
index 2286404..39cfad1 100644
--- a/src/Lucene.Net.Core/Index/LogMergePolicy.cs
+++ b/src/Lucene.Net.Core/Index/LogMergePolicy.cs
@@ -399,7 +399,7 @@ namespace Lucene.Net.Index
             while (last > 0)
             {
                 SegmentCommitInfo info = infos.Info(--last);
-                if (segmentsToMerge[info] != null)
+                if (segmentsToMerge.ContainsKey(info))
                 {
                     last++;
                     break;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c9caf7c3/src/Lucene.Net.Core/Search/Query.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Query.cs b/src/Lucene.Net.Core/Search/Query.cs
index 1448093..affbdc5 100644
--- a/src/Lucene.Net.Core/Search/Query.cs
+++ b/src/Lucene.Net.Core/Search/Query.cs
@@ -134,17 +134,18 @@ namespace Lucene.Net.Search
                 return true;
             }
 
-            if (GetType() != obj.GetType())
+            if (obj == null)
             {
                 return false;
             }
 
-            var other = obj as Query;
-            if (other == null)
+            if (GetType() != obj.GetType())
             {
                 return false;
             }
 
+            var other = obj as Query;
+
             if (Number.FloatToIntBits(Boost) != Number.FloatToIntBits(other.Boost))
             {
                 return false;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c9caf7c3/src/Lucene.Net.Tests/core/Search/TestLiveFieldValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestLiveFieldValues.cs b/src/Lucene.Net.Tests/core/Search/TestLiveFieldValues.cs
index f761b08..6abc4e2 100644
--- a/src/Lucene.Net.Tests/core/Search/TestLiveFieldValues.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestLiveFieldValues.cs
@@ -196,7 +196,7 @@ namespace Lucene.Net.Search
                             doc.Add(new IntField("field", (int)field, Field.Store.YES));
                             w.UpdateDocument(new Term("id", id), doc);
                             Rt.Add(id, field);
-                            if (values[id] == null)//Key didn't exist before
+                            if (!values.ContainsKey(id))//Key didn't exist before
                             {
                                 allIDs.Add(id);
                             }


Mime
View raw message