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 2015/01/17 17:09:39 UTC
lucenenet git commit: fix ReverseByteReader Position setter
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 <la...@gmail.com>
Authored: Fri Jan 16 10:07:34 2015 -0500
Committer: Laimonas Simutis <la...@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);
}
}