lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [4/8] lucenenet git commit: Lucene.Net.Util.Fst.FSTEnum: Potential issue if ReadNextArcLabel() is not called from Debug.Assert
Date Sun, 09 Apr 2017 13:08:51 GMT
Lucene.Net.Util.Fst.FSTEnum: Potential issue if ReadNextArcLabel() is not called from Debug.Assert


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

Branch: refs/heads/api-work
Commit: f604a1a76ed7305a3271c523d09d68f604770fdc
Parents: 5507808
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Apr 9 18:33:44 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Apr 9 18:33:44 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net/Util/Fst/FSTEnum.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f604a1a7/src/Lucene.Net/Util/Fst/FSTEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Fst/FSTEnum.cs b/src/Lucene.Net/Util/Fst/FSTEnum.cs
index a378b39..331cbf1 100644
--- a/src/Lucene.Net/Util/Fst/FSTEnum.cs
+++ b/src/Lucene.Net/Util/Fst/FSTEnum.cs
@@ -422,7 +422,8 @@ namespace Lucene.Net.Util.Fst
                         arc.ArcIdx = (low > high ? high : low) - 1;
                         //System.out.println(" hasFloor arcIdx=" + (arc.arcIdx+1));
                         m_fst.ReadNextRealArc(arc, @in);
-                        Debug.Assert(arc.IsLast || m_fst.ReadNextArcLabel(arc, @in) >
targetLabel);
+                        int label = m_fst.ReadNextArcLabel(arc, @in);
+                        Debug.Assert(arc.IsLast || label > targetLabel);
                         Debug.Assert(arc.Label < targetLabel, "arc.label=" + arc.Label
+ " vs targetLabel=" + targetLabel);
                         PushLast();
                         return;


Mime
View raw message