lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: fix ReverseByteReader Position setter
Date Sat, 17 Jan 2015 16:09:39 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 5eeb32236 -> ab58fa245


fix ReverseByteReader Position setter


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

Branch: refs/heads/master
Commit: ab58fa245516076f6aa2322af1998cbf61777b0d
Parents: 5eeb322
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Fri Jan 16 10:07:34 2015 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Fri Jan 16 10:07:34 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Fst/BytesStore.cs | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ab58fa24/src/Lucene.Net.Core/Util/Fst/BytesStore.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Fst/BytesStore.cs b/src/Lucene.Net.Core/Util/Fst/BytesStore.cs
index 878d73a..6246863 100644
--- a/src/Lucene.Net.Core/Util/Fst/BytesStore.cs
+++ b/src/Lucene.Net.Core/Util/Fst/BytesStore.cs
@@ -482,12 +482,8 @@ namespace Lucene.Net.Util.Fst
                 }
                 set
                 {
-                    // NOTE: a little weird because if you
-                    // setPosition(0), the next byte you read is
-                    // bytes[0] ... but I would expect bytes[-1] (ie,
-                    // EOF)...?
                     int bufferIndex = (int)(value >> OuterInstance.blockBits);
-                    nextBuffer = bufferIndex - 1;
+                    nextBuffer = bufferIndex + 1;
                     OuterInstance.Current = OuterInstance.Blocks[bufferIndex];
                     nextRead = (int)(value & OuterInstance.BlockMask);
                     Debug.Assert(OuterInstance.Position == value, "pos=" + value + " getPos()="
+ OuterInstance.Position);
@@ -564,12 +560,15 @@ namespace Lucene.Net.Util.Fst
                 }
                 set
                 {
+                    // NOTE: a little weird because if you
+                    // setPosition(0), the next byte you read is
+                    // bytes[0] ... but I would expect bytes[-1] (ie,
+                    // EOF)...?
                     int bufferIndex = (int)(value >> OuterInstance.blockBits);
-                    nextBuffer = bufferIndex + 1;
+                    nextBuffer = bufferIndex - 1;
                     OuterInstance.Current = OuterInstance.Blocks[bufferIndex];
                     nextRead = (int)(value & OuterInstance.BlockMask);
-                    //LUCENE TODO: Put this back
-                    //Debug.Assert(OuterInstance.Position == value);
+                    Debug.Assert(OuterInstance.Position == value, "value=" + value + " this.Position="
+ this.Position);
                 }
             }
 


Mime
View raw message