You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2016/10/02 15:02:28 UTC
[02/10] lucenenet git commit: Fixed bugs in the
Analysis.Synonym.SlowSynonymFilter that were causing 3 tests to fail by not
polling the correct buffer.
Fixed bugs in the Analysis.Synonym.SlowSynonymFilter that were causing 3 tests to fail by not polling the correct buffer.
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/7da43ad1
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/7da43ad1
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/7da43ad1
Branch: refs/heads/master
Commit: 7da43ad128c369a7c88efbbfa230faf7f415c48f
Parents: bf7c2b4
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Sep 22 20:30:37 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sun Oct 2 21:43:59 2016 +0700
----------------------------------------------------------------------
.../Analysis/Synonym/SlowSynonymFilter.cs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7da43ad1/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
index d06821c..d06bab2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
@@ -188,14 +188,13 @@ namespace Lucene.Net.Analysis.Synonym
origPosInc.PositionIncrement = origPos - pos;
generated.Add(origTok);
pos += origPosInc.PositionIncrement;
- //origTok = matched.Count == 0 ? null : matched.RemoveFirst();
if (matched.Count == 0)
{
origTok = null;
}
else
{
- origTok = matched.Count > 0 ? matched.First.Value : null;
+ origTok = matched.First.Value;
matched.RemoveFirst();
}
if (origTok != null)
@@ -230,7 +229,7 @@ namespace Lucene.Net.Analysis.Synonym
{
if (buffer != null && buffer.Count > 0)
{
- var first = matched.Count > 0 ? matched.First.Value : null;
+ var first = buffer.First.Value;
buffer.RemoveFirst();
return first;