lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [18/27] lucenenet git commit: Lucene.Net.Core.Search.Spans.SpanOrQuery: fixed ToString() so it doesn't need to remove chars from the StringBuilder
Date Sun, 05 Feb 2017 16:51:53 GMT
Lucene.Net.Core.Search.Spans.SpanOrQuery: fixed ToString() so it doesn't need to remove chars
from the StringBuilder


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

Branch: refs/heads/api-work
Commit: 6c2b8de73fa1f4166da1f47f9c43518964d55f88
Parents: bab4add
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Feb 5 17:46:21 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Feb 5 17:46:21 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6c2b8de7/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs b/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
index 08a2ab0..2d1758a 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanOrQuery.cs
@@ -131,15 +131,14 @@ namespace Lucene.Net.Search.Spans
             StringBuilder buffer = new StringBuilder();
             buffer.Append("spanOr([");
             IEnumerator<SpanQuery> i = clauses.GetEnumerator();
+            bool first = true;
             while (i.MoveNext())
             {
                 SpanQuery clause = i.Current;
+                if (!first) buffer.Append(", ");
                 buffer.Append(clause.ToString(field));
-                buffer.Append(", ");
+                first = false;
             }
-            //LUCENE TO-DO
-            if (clauses.Count > 0)
-                buffer.Remove(buffer.Length - 2, 2);
             buffer.Append("])");
             buffer.Append(ToStringUtils.Boost(Boost));
             return buffer.ToString();


Mime
View raw message