lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/3] lucenenet git commit: fix reverse byte reader
Date Thu, 16 Apr 2015 01:30:36 GMT
fix reverse byte reader


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

Branch: refs/heads/master
Commit: 8b9ae9cbb7d77e04924d4df260ce09372f47e3e6
Parents: b61e2b9
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Wed Apr 15 20:59:34 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Wed Apr 15 20:59:34 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Fst/BytesStore.cs                | 10 +++++-----
 .../Codecs/lucene42/Lucene42DocValuesConsumer.cs          |  3 ++-
 .../Index/BaseDocValuesFormatTestCase.cs                  |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b9ae9cb/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 472d630..bf81fb5 100644
--- a/src/Lucene.Net.Core/Util/Fst/BytesStore.cs
+++ b/src/Lucene.Net.Core/Util/Fst/BytesStore.cs
@@ -520,12 +520,12 @@ namespace Lucene.Net.Util.Fst
             public ReverseBytesReaderAnonymousInner(BytesStore outerInstance)
             {
                 this.OuterInstance = outerInstance;
-                outerInstance.Current = outerInstance.Blocks.Count == 0 ? null : outerInstance.Blocks[0];
+                Current = outerInstance.Blocks.Count == 0 ? null : outerInstance.Blocks[0];
                 nextBuffer = -1;
                 nextRead = 0;
             }
 
-            private sbyte[] Current;
+            private byte[] Current;
             private int nextBuffer;
             private int nextRead;
 
@@ -533,10 +533,10 @@ namespace Lucene.Net.Util.Fst
             {
                 if (nextRead == -1)
                 {
-                    OuterInstance.Current = OuterInstance.Blocks[nextBuffer--];
+                    Current = OuterInstance.Blocks[nextBuffer--];
                     nextRead = OuterInstance.BlockSize - 1;
                 }
-                return OuterInstance.Current[nextRead--];
+                return Current[nextRead--];
             }
 
             public override void SkipBytes(int count)
@@ -566,7 +566,7 @@ namespace Lucene.Net.Util.Fst
                     // EOF)...?
                     int bufferIndex = (int)(value >> OuterInstance.blockBits);
                     nextBuffer = bufferIndex - 1;
-                    OuterInstance.Current = OuterInstance.Blocks[bufferIndex];
+                    Current = OuterInstance.Blocks[bufferIndex];
                     nextRead = (int)(value & OuterInstance.BlockMask);
                     Debug.Assert(this.Position == value, "value=" + value + " this.Position="
+ this.Position);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b9ae9cb/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs b/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs
index a479571..80d6c27 100644
--- a/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs
@@ -296,7 +296,8 @@ namespace Lucene.Net.Codecs.Lucene42
                 builder.Add(Util.ToIntsRef(v, scratch), ord);
                 ord++;
             }
-            Lucene.Net.Util.Fst.FST<long?> fst = builder.Finish();
+
+            var fst = builder.Finish();
             if (fst != null)
             {
                 fst.Save(Data);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b9ae9cb/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
index 970805c..ae7e1fc 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
@@ -992,7 +992,7 @@ namespace Lucene.Net.Index
             Document doc = new Document();
             var bytes = new byte[32766];
             BytesRef b = new BytesRef(bytes);
-            Random().NextBytes((byte[])(Array)bytes);
+            Random().NextBytes(bytes);
             doc.Add(new BinaryDocValuesField("dv", b));
             iwriter.AddDocument(doc);
             iwriter.Dispose();


Mime
View raw message