lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: More sbyte->byte fixes, cleanup
Date Sun, 01 Feb 2015 12:05:00 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master f300a4de6 -> 3fb54eeb7


More sbyte->byte fixes, cleanup


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

Branch: refs/heads/master
Commit: 3fb54eeb7887db27dda0808a005a1a7f9e23c4f8
Parents: f300a4d
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Sun Feb 1 14:02:52 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Sun Feb 1 14:02:52 2015 +0200

----------------------------------------------------------------------
 .../Codecs/Lucene40/Lucene40DocValuesReader.cs  | 164 +++++++------------
 .../Lucene42/Lucene42DocValuesProducer.cs       | 147 +++++++----------
 2 files changed, 124 insertions(+), 187 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3fb54eeb/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
index 4ada913..8671542 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
@@ -141,17 +141,17 @@ namespace Lucene.Net.Codecs.Lucene40
         private NumericDocValues LoadVarIntsField(FieldInfo field, IndexInput input)
         {
             CodecUtil.CheckHeader(input, Lucene40DocValuesFormat.VAR_INTS_CODEC_NAME, Lucene40DocValuesFormat.VAR_INTS_VERSION_START,
Lucene40DocValuesFormat.VAR_INTS_VERSION_CURRENT);
-            byte header = input.ReadByte();
+            var header = (sbyte)input.ReadByte();
             if (header == Lucene40DocValuesFormat.VAR_INTS_FIXED_64)
             {
                 int maxDoc = State.SegmentInfo.DocCount;
-                long[] values = new long[maxDoc];
+                var values = new long[maxDoc];
                 for (int i = 0; i < values.Length; i++)
                 {
                     values[i] = input.ReadLong();
                 }
                 RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-                return new NumericDocValuesAnonymousInnerClassHelper(this, values);
+                return new NumericDocValuesAnonymousInnerClassHelper(values);
             }
             else if (header == Lucene40DocValuesFormat.VAR_INTS_PACKED)
             {
@@ -159,7 +159,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 long defaultValue = input.ReadLong();
                 PackedInts.Reader reader = PackedInts.GetReader(input);
                 RamBytesUsed_Renamed.AddAndGet(reader.RamBytesUsed());
-                return new NumericDocValuesAnonymousInnerClassHelper2(this, minValue, defaultValue,
reader);
+                return new NumericDocValuesAnonymousInnerClassHelper2(minValue, defaultValue,
reader);
             }
             else
             {
@@ -169,13 +169,10 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class NumericDocValuesAnonymousInnerClassHelper : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly long[] Values;
 
-            private long[] Values;
-
-            public NumericDocValuesAnonymousInnerClassHelper(Lucene40DocValuesReader outerInstance,
long[] values)
+            public NumericDocValuesAnonymousInnerClassHelper(long[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 
@@ -187,15 +184,12 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class NumericDocValuesAnonymousInnerClassHelper2 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private long MinValue;
-            private long DefaultValue;
-            private PackedInts.Reader Reader;
+            private readonly long MinValue;
+            private readonly long DefaultValue;
+            private readonly PackedInts.Reader Reader;
 
-            public NumericDocValuesAnonymousInnerClassHelper2(Lucene40DocValuesReader outerInstance,
long minValue, long defaultValue, PackedInts.Reader reader)
+            public NumericDocValuesAnonymousInnerClassHelper2(long minValue, long defaultValue,
PackedInts.Reader reader)
             {
-                this.OuterInstance = outerInstance;
                 this.MinValue = minValue;
                 this.DefaultValue = defaultValue;
                 this.Reader = reader;
@@ -227,14 +221,14 @@ namespace Lucene.Net.Codecs.Lucene40
             var values = new byte[maxDoc];
             input.ReadBytes(values, 0, values.Length);
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-            return new NumericDocValuesAnonymousInnerClassHelper3(this, values);
+            return new NumericDocValuesAnonymousInnerClassHelper3(values);
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper3 : NumericDocValues
         {
             private readonly byte[] Values;
 
-            public NumericDocValuesAnonymousInnerClassHelper3(Lucene40DocValuesReader outerInstance,
byte[] values)
+            public NumericDocValuesAnonymousInnerClassHelper3(byte[] values)
             {
                 this.Values = values;
             }
@@ -260,18 +254,15 @@ namespace Lucene.Net.Codecs.Lucene40
                 values[i] = input.ReadShort();
             }
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-            return new NumericDocValuesAnonymousInnerClassHelper4(this, values);
+            return new NumericDocValuesAnonymousInnerClassHelper4(values);
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper4 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly short[] Values;
 
-            private short[] Values;
-
-            public NumericDocValuesAnonymousInnerClassHelper4(Lucene40DocValuesReader outerInstance,
short[] values)
+            public NumericDocValuesAnonymousInnerClassHelper4(short[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 
@@ -290,24 +281,21 @@ namespace Lucene.Net.Codecs.Lucene40
                 throw new CorruptIndexException("invalid valueSize: " + valueSize);
             }
             int maxDoc = State.SegmentInfo.DocCount;
-            int[] values = new int[maxDoc];
+            var values = new int[maxDoc];
             for (int i = 0; i < values.Length; i++)
             {
                 values[i] = input.ReadInt();
             }
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-            return new NumericDocValuesAnonymousInnerClassHelper5(this, values);
+            return new NumericDocValuesAnonymousInnerClassHelper5(values);
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper5 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly int[] Values;
 
-            private int[] Values;
-
-            public NumericDocValuesAnonymousInnerClassHelper5(Lucene40DocValuesReader outerInstance,
int[] values)
+            public NumericDocValuesAnonymousInnerClassHelper5(int[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 
@@ -332,18 +320,15 @@ namespace Lucene.Net.Codecs.Lucene40
                 values[i] = input.ReadLong();
             }
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-            return new NumericDocValuesAnonymousInnerClassHelper6(this, values);
+            return new NumericDocValuesAnonymousInnerClassHelper6(values);
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper6 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private long[] Values;
+            private readonly long[] Values;
 
-            public NumericDocValuesAnonymousInnerClassHelper6(Lucene40DocValuesReader outerInstance,
long[] values)
+            public NumericDocValuesAnonymousInnerClassHelper6(long[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 
@@ -368,18 +353,15 @@ namespace Lucene.Net.Codecs.Lucene40
                 values[i] = input.ReadInt();
             }
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-            return new NumericDocValuesAnonymousInnerClassHelper7(this, values);
+            return new NumericDocValuesAnonymousInnerClassHelper7(values);
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper7 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly int[] Values;
 
-            private int[] Values;
-
-            public NumericDocValuesAnonymousInnerClassHelper7(Lucene40DocValuesReader outerInstance,
int[] values)
+            public NumericDocValuesAnonymousInnerClassHelper7(int[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 
@@ -404,18 +386,15 @@ namespace Lucene.Net.Codecs.Lucene40
                 values[i] = input.ReadLong();
             }
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
-            return new NumericDocValuesAnonymousInnerClassHelper8(this, values);
+            return new NumericDocValuesAnonymousInnerClassHelper8(values);
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper8 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private long[] Values;
+            private readonly long[] Values;
 
-            public NumericDocValuesAnonymousInnerClassHelper8(Lucene40DocValuesReader outerInstance,
long[] values)
+            public NumericDocValuesAnonymousInnerClassHelper8(long[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 
@@ -469,13 +448,13 @@ namespace Lucene.Net.Codecs.Lucene40
             {
                 CodecUtil.CheckHeader(input, Lucene40DocValuesFormat.BYTES_FIXED_STRAIGHT_CODEC_NAME,
Lucene40DocValuesFormat.BYTES_FIXED_STRAIGHT_VERSION_START, Lucene40DocValuesFormat.BYTES_FIXED_STRAIGHT_VERSION_CURRENT);
                 int fixedLength = input.ReadInt();
-                PagedBytes bytes = new PagedBytes(16);
+                var bytes = new PagedBytes(16);
                 bytes.Copy(input, fixedLength * (long)State.SegmentInfo.DocCount);
                 PagedBytes.Reader bytesReader = bytes.Freeze(true);
                 CodecUtil.CheckEOF(input);
                 success = true;
                 RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed());
-                return new BinaryDocValuesAnonymousInnerClassHelper(this, fixedLength, bytesReader);
+                return new BinaryDocValuesAnonymousInnerClassHelper(fixedLength, bytesReader);
             }
             finally
             {
@@ -492,14 +471,11 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class BinaryDocValuesAnonymousInnerClassHelper : BinaryDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private int FixedLength;
-            private PagedBytes.Reader BytesReader;
+            private readonly int FixedLength;
+            private readonly PagedBytes.Reader BytesReader;
 
-            public BinaryDocValuesAnonymousInnerClassHelper(Lucene40DocValuesReader outerInstance,
int fixedLength, PagedBytes.Reader bytesReader)
+            public BinaryDocValuesAnonymousInnerClassHelper(int fixedLength, PagedBytes.Reader
bytesReader)
             {
-                this.OuterInstance = outerInstance;
                 this.FixedLength = fixedLength;
                 this.BytesReader = bytesReader;
             }
@@ -532,7 +508,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 CodecUtil.CheckEOF(index);
                 success = true;
                 RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + reader.RamBytesUsed());
-                return new BinaryDocValuesAnonymousInnerClassHelper2(this, bytesReader, reader);
+                return new BinaryDocValuesAnonymousInnerClassHelper2(bytesReader, reader);
             }
             finally
             {
@@ -549,14 +525,11 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class BinaryDocValuesAnonymousInnerClassHelper2 : BinaryDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly PackedInts.Reader Reader;
 
-            private PagedBytes.Reader BytesReader;
-            private PackedInts.Reader Reader;
-
-            public BinaryDocValuesAnonymousInnerClassHelper2(Lucene40DocValuesReader outerInstance,
PagedBytes.Reader bytesReader, PackedInts.Reader reader)
+            public BinaryDocValuesAnonymousInnerClassHelper2(PagedBytes.Reader bytesReader,
PackedInts.Reader reader)
             {
-                this.OuterInstance = outerInstance;
                 this.BytesReader = bytesReader;
                 this.Reader = reader;
             }
@@ -593,7 +566,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 CodecUtil.CheckEOF(index);
                 RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + reader.RamBytesUsed());
                 success = true;
-                return new BinaryDocValuesAnonymousInnerClassHelper3(this, fixedLength, bytesReader,
reader);
+                return new BinaryDocValuesAnonymousInnerClassHelper3(fixedLength, bytesReader,
reader);
             }
             finally
             {
@@ -610,15 +583,12 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class BinaryDocValuesAnonymousInnerClassHelper3 : BinaryDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private int FixedLength;
-            private PagedBytes.Reader BytesReader;
-            private PackedInts.Reader Reader;
+            private readonly int FixedLength;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly PackedInts.Reader Reader;
 
-            public BinaryDocValuesAnonymousInnerClassHelper3(Lucene40DocValuesReader outerInstance,
int fixedLength, PagedBytes.Reader bytesReader, PackedInts.Reader reader)
+            public BinaryDocValuesAnonymousInnerClassHelper3(int fixedLength, PagedBytes.Reader
bytesReader, PackedInts.Reader reader)
             {
-                this.OuterInstance = outerInstance;
                 this.FixedLength = fixedLength;
                 this.BytesReader = bytesReader;
                 this.Reader = reader;
@@ -654,7 +624,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 CodecUtil.CheckEOF(index);
                 RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + reader.RamBytesUsed());
                 success = true;
-                return new BinaryDocValuesAnonymousInnerClassHelper4(this, bytesReader, reader);
+                return new BinaryDocValuesAnonymousInnerClassHelper4(bytesReader, reader);
             }
             finally
             {
@@ -671,14 +641,11 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class BinaryDocValuesAnonymousInnerClassHelper4 : BinaryDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly PackedInts.Reader Reader;
 
-            private PagedBytes.Reader BytesReader;
-            private PackedInts.Reader Reader;
-
-            public BinaryDocValuesAnonymousInnerClassHelper4(Lucene40DocValuesReader outerInstance,
PagedBytes.Reader bytesReader, PackedInts.Reader reader)
+            public BinaryDocValuesAnonymousInnerClassHelper4(PagedBytes.Reader bytesReader,
PackedInts.Reader reader)
             {
-                this.OuterInstance = outerInstance;
                 this.BytesReader = bytesReader;
                 this.Reader = reader;
             }
@@ -770,21 +737,18 @@ namespace Lucene.Net.Codecs.Lucene40
             PackedInts.Reader reader = PackedInts.GetReader(index);
             RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + reader.RamBytesUsed());
 
-            return CorrectBuggyOrds(new SortedDocValuesAnonymousInnerClassHelper(this, fixedLength,
valueCount, bytesReader, reader));
+            return CorrectBuggyOrds(new SortedDocValuesAnonymousInnerClassHelper(fixedLength,
valueCount, bytesReader, reader));
         }
 
         private class SortedDocValuesAnonymousInnerClassHelper : SortedDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private int FixedLength;
-            private int valueCount;
-            private PagedBytes.Reader BytesReader;
-            private PackedInts.Reader Reader;
+            private readonly int FixedLength;
+            private readonly int valueCount;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly PackedInts.Reader Reader;
 
-            public SortedDocValuesAnonymousInnerClassHelper(Lucene40DocValuesReader outerInstance,
int fixedLength, int valueCount, PagedBytes.Reader bytesReader, PackedInts.Reader reader)
+            public SortedDocValuesAnonymousInnerClassHelper(int fixedLength, int valueCount,
PagedBytes.Reader bytesReader, PackedInts.Reader reader)
             {
-                this.OuterInstance = outerInstance;
                 this.FixedLength = fixedLength;
                 this.valueCount = valueCount;
                 this.BytesReader = bytesReader;
@@ -825,21 +789,18 @@ namespace Lucene.Net.Codecs.Lucene40
             int valueCount = addressReader.Size() - 1;
             RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + addressReader.RamBytesUsed()
+ ordsReader.RamBytesUsed());
 
-            return CorrectBuggyOrds(new SortedDocValuesAnonymousInnerClassHelper2(this, bytesReader,
addressReader, ordsReader, valueCount));
+            return CorrectBuggyOrds(new SortedDocValuesAnonymousInnerClassHelper2(bytesReader,
addressReader, ordsReader, valueCount));
         }
 
         private class SortedDocValuesAnonymousInnerClassHelper2 : SortedDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly PackedInts.Reader AddressReader;
+            private readonly PackedInts.Reader OrdsReader;
+            private readonly int valueCount;
 
-            private PagedBytes.Reader BytesReader;
-            private PackedInts.Reader AddressReader;
-            private PackedInts.Reader OrdsReader;
-            private int valueCount;
-
-            public SortedDocValuesAnonymousInnerClassHelper2(Lucene40DocValuesReader outerInstance,
PagedBytes.Reader bytesReader, PackedInts.Reader addressReader, PackedInts.Reader ordsReader,
int valueCount)
+            public SortedDocValuesAnonymousInnerClassHelper2(PagedBytes.Reader bytesReader,
PackedInts.Reader addressReader, PackedInts.Reader ordsReader, int valueCount)
             {
-                this.OuterInstance = outerInstance;
                 this.BytesReader = bytesReader;
                 this.AddressReader = addressReader;
                 this.OrdsReader = ordsReader;
@@ -880,18 +841,15 @@ namespace Lucene.Net.Codecs.Lucene40
             }
 
             // we had ord holes, return an ord-shifting-impl that corrects the bug
-            return new SortedDocValuesAnonymousInnerClassHelper3(this, @in);
+            return new SortedDocValuesAnonymousInnerClassHelper3(@in);
         }
 
         private class SortedDocValuesAnonymousInnerClassHelper3 : SortedDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private SortedDocValues @in;
+            private readonly SortedDocValues @in;
 
-            public SortedDocValuesAnonymousInnerClassHelper3(Lucene40DocValuesReader outerInstance,
SortedDocValues @in)
+            public SortedDocValuesAnonymousInnerClassHelper3(SortedDocValues @in)
             {
-                this.OuterInstance = outerInstance;
                 this.@in = @in;
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3fb54eeb/src/Lucene.Net.Core/Codecs/Lucene42/Lucene42DocValuesProducer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene42/Lucene42DocValuesProducer.cs b/src/Lucene.Net.Core/Codecs/Lucene42/Lucene42DocValuesProducer.cs
index c024bac..802ed53 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene42/Lucene42DocValuesProducer.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene42/Lucene42DocValuesProducer.cs
@@ -254,7 +254,7 @@ namespace Lucene.Net.Codecs.Lucene42
                     {
                         throw new CorruptIndexException("TABLE_COMPRESSED cannot have more
than 256 distinct values, input=" + Data);
                     }
-                    long[] decode = new long[size];
+                    var decode = new long[size];
                     for (int i = 0; i < decode.Length; i++)
                     {
                         decode[i] = Data.ReadLong();
@@ -263,11 +263,11 @@ namespace Lucene.Net.Codecs.Lucene42
                     int bitsPerValue = Data.ReadVInt();
                     PackedInts.Reader ordsReader = PackedInts.GetReaderNoHeader(Data, PackedInts.Format.ById(formatID),
entry.PackedIntsVersion, MaxDoc, bitsPerValue);
                     RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(decode) + ordsReader.RamBytesUsed());
-                    return new NumericDocValuesAnonymousInnerClassHelper(this, decode, ordsReader);
+                    return new NumericDocValuesAnonymousInnerClassHelper(decode, ordsReader);
 
                 case DELTA_COMPRESSED:
                     int blockSize = Data.ReadVInt();
-                    BlockPackedReader reader = new BlockPackedReader(Data, entry.PackedIntsVersion,
blockSize, MaxDoc, false);
+                    var reader = new BlockPackedReader(Data, entry.PackedIntsVersion, blockSize,
MaxDoc, false);
                     RamBytesUsed_Renamed.AddAndGet(reader.RamBytesUsed());
                     return reader;
 
@@ -283,7 +283,7 @@ namespace Lucene.Net.Codecs.Lucene42
                     int quotientBlockSize = Data.ReadVInt();
                     BlockPackedReader quotientReader = new BlockPackedReader(Data, entry.PackedIntsVersion,
quotientBlockSize, MaxDoc, false);
                     RamBytesUsed_Renamed.AddAndGet(quotientReader.RamBytesUsed());
-                    return new NumericDocValuesAnonymousInnerClassHelper3(this, min, mult,
quotientReader);
+                    return new NumericDocValuesAnonymousInnerClassHelper3(min, mult, quotientReader);
 
                 default:
                     throw new InvalidOperationException();
@@ -292,14 +292,11 @@ namespace Lucene.Net.Codecs.Lucene42
 
         private class NumericDocValuesAnonymousInnerClassHelper : NumericDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
+            private readonly long[] Decode;
+            private readonly PackedInts.Reader OrdsReader;
 
-            private long[] Decode;
-            private PackedInts.Reader OrdsReader;
-
-            public NumericDocValuesAnonymousInnerClassHelper(Lucene42DocValuesProducer outerInstance,
long[] decode, PackedInts.Reader ordsReader)
+            public NumericDocValuesAnonymousInnerClassHelper(long[] decode, PackedInts.Reader
ordsReader)
             {
-                this.OuterInstance = outerInstance;
                 this.Decode = decode;
                 this.OrdsReader = ordsReader;
             }
@@ -312,33 +309,27 @@ namespace Lucene.Net.Codecs.Lucene42
 
         private class NumericDocValuesAnonymousInnerClassHelper2 : NumericDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
-
-            private byte[] Bytes;
+            private readonly byte[] Bytes;
 
             public NumericDocValuesAnonymousInnerClassHelper2(Lucene42DocValuesProducer outerInstance,
byte[] bytes)
             {
-                this.OuterInstance = outerInstance;
                 this.Bytes = bytes;
             }
 
             public override long Get(int docID)
             {
-                return Bytes[docID];
+                return (sbyte)Bytes[docID];
             }
         }
 
         private class NumericDocValuesAnonymousInnerClassHelper3 : NumericDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
+            private readonly long Min;
+            private readonly long Mult;
+            private readonly BlockPackedReader QuotientReader;
 
-            private long Min;
-            private long Mult;
-            private BlockPackedReader QuotientReader;
-
-            public NumericDocValuesAnonymousInnerClassHelper3(Lucene42DocValuesProducer outerInstance,
long min, long mult, BlockPackedReader quotientReader)
+            public NumericDocValuesAnonymousInnerClassHelper3(long min, long mult, BlockPackedReader
quotientReader)
             {
-                this.OuterInstance = outerInstance;
                 this.Min = min;
                 this.Mult = mult;
                 this.QuotientReader = quotientReader;
@@ -375,26 +366,23 @@ namespace Lucene.Net.Codecs.Lucene42
             {
                 int fixedLength = entry.MinLength;
                 RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed());
-                return new BinaryDocValuesAnonymousInnerClassHelper(this, bytesReader, fixedLength);
+                return new BinaryDocValuesAnonymousInnerClassHelper(bytesReader, fixedLength);
             }
             else
             {
                 MonotonicBlockPackedReader addresses = new MonotonicBlockPackedReader(Data,
entry.PackedIntsVersion, entry.BlockSize, MaxDoc, false);
                 RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + addresses.RamBytesUsed());
-                return new BinaryDocValuesAnonymousInnerClassHelper2(this, bytesReader, addresses);
+                return new BinaryDocValuesAnonymousInnerClassHelper2(bytesReader, addresses);
             }
         }
 
         private class BinaryDocValuesAnonymousInnerClassHelper : BinaryDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
-
-            private PagedBytes.Reader BytesReader;
-            private int FixedLength;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly int FixedLength;
 
-            public BinaryDocValuesAnonymousInnerClassHelper(Lucene42DocValuesProducer outerInstance,
PagedBytes.Reader bytesReader, int fixedLength)
+            public BinaryDocValuesAnonymousInnerClassHelper(PagedBytes.Reader bytesReader,
int fixedLength)
             {
-                this.OuterInstance = outerInstance;
                 this.BytesReader = bytesReader;
                 this.FixedLength = fixedLength;
             }
@@ -407,14 +395,11 @@ namespace Lucene.Net.Codecs.Lucene42
 
         private class BinaryDocValuesAnonymousInnerClassHelper2 : BinaryDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
+            private readonly PagedBytes.Reader BytesReader;
+            private readonly MonotonicBlockPackedReader Addresses;
 
-            private PagedBytes.Reader BytesReader;
-            private MonotonicBlockPackedReader Addresses;
-
-            public BinaryDocValuesAnonymousInnerClassHelper2(Lucene42DocValuesProducer outerInstance,
PagedBytes.Reader bytesReader, MonotonicBlockPackedReader addresses)
+            public BinaryDocValuesAnonymousInnerClassHelper2(PagedBytes.Reader bytesReader,
MonotonicBlockPackedReader addresses)
             {
-                this.OuterInstance = outerInstance;
                 this.BytesReader = bytesReader;
                 this.Addresses = addresses;
             }
@@ -441,35 +426,32 @@ namespace Lucene.Net.Codecs.Lucene42
                     FstInstances[field.Number] = instance;
                 }
             }
-            NumericDocValues docToOrd = GetNumeric(field);
-            FST<long?> fst = instance;
+            var docToOrd = GetNumeric(field);
+            var fst = instance;
 
             // per-thread resources
-            FST<long?>.BytesReader @in = fst.BytesReader;
-            FST<long?>.Arc<long?> firstArc = new FST<long?>.Arc<long?>();
-            FST<long?>.Arc<long?> scratchArc = new FST<long?>.Arc<long?>();
-            IntsRef scratchInts = new IntsRef();
-            BytesRefFSTEnum<long?> fstEnum = new BytesRefFSTEnum<long?>(fst);
+            var @in = fst.BytesReader;
+            var firstArc = new FST<long?>.Arc<long?>();
+            var scratchArc = new FST<long?>.Arc<long?>();
+            var scratchInts = new IntsRef();
+            var fstEnum = new BytesRefFSTEnum<long?>(fst);
 
-            return new SortedDocValuesAnonymousInnerClassHelper(this, entry, docToOrd, fst,
@in, firstArc, scratchArc, scratchInts, fstEnum);
+            return new SortedDocValuesAnonymousInnerClassHelper(entry, docToOrd, fst, @in,
firstArc, scratchArc, scratchInts, fstEnum);
         }
 
         private class SortedDocValuesAnonymousInnerClassHelper : SortedDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
+            private readonly FSTEntry Entry;
+            private readonly NumericDocValues DocToOrd;
+            private readonly FST<long?> Fst;
+            private readonly FST<long?>.BytesReader @in;
+            private readonly FST<long?>.Arc<long?> FirstArc;
+            private readonly FST<long?>.Arc<long?> ScratchArc;
+            private readonly IntsRef ScratchInts;
+            private readonly BytesRefFSTEnum<long?> FstEnum;
 
-            private FSTEntry Entry;
-            private NumericDocValues DocToOrd;
-            private FST<long?> Fst;
-            private FST<long?>.BytesReader @in;
-            private FST<long?>.Arc<long?> FirstArc;
-            private FST<long?>.Arc<long?> ScratchArc;
-            private IntsRef ScratchInts;
-            private BytesRefFSTEnum<long?> FstEnum;
-
-            public SortedDocValuesAnonymousInnerClassHelper(Lucene42DocValuesProducer outerInstance,
FSTEntry entry, NumericDocValues docToOrd, FST<long?> fst, FST<long?>.BytesReader
@in, FST<long?>.Arc<long?> firstArc, FST<long?>.Arc<long?> scratchArc,
IntsRef scratchInts, BytesRefFSTEnum<long?> fstEnum)
+            public SortedDocValuesAnonymousInnerClassHelper(FSTEntry entry, NumericDocValues
docToOrd, FST<long?> fst, FST<long?>.BytesReader @in, FST<long?>.Arc<long?>
firstArc, FST<long?>.Arc<long?> scratchArc, IntsRef scratchInts, BytesRefFSTEnum<long?>
fstEnum)
             {
-                this.OuterInstance = outerInstance;
                 this.Entry = entry;
                 this.DocToOrd = docToOrd;
                 this.Fst = fst;
@@ -563,34 +545,31 @@ namespace Lucene.Net.Codecs.Lucene42
             FST<long?> fst = instance;
 
             // per-thread resources
-            FST<long?>.BytesReader @in = fst.BytesReader;
-            FST<long?>.Arc<long?> firstArc = new FST<long?>.Arc<long?>();
-            FST<long?>.Arc<long?> scratchArc = new FST<long?>.Arc<long?>();
-            IntsRef scratchInts = new IntsRef();
-            BytesRefFSTEnum<long?> fstEnum = new BytesRefFSTEnum<long?>(fst);
-            BytesRef @ref = new BytesRef();
-            ByteArrayDataInput input = new ByteArrayDataInput();
-            return new SortedSetDocValuesAnonymousInnerClassHelper(this, entry, docToOrds,
fst, @in, firstArc, scratchArc, scratchInts, fstEnum, @ref, input);
+            var @in = fst.BytesReader;
+            var firstArc = new FST<long?>.Arc<long?>();
+            var scratchArc = new FST<long?>.Arc<long?>();
+            var scratchInts = new IntsRef();
+            var fstEnum = new BytesRefFSTEnum<long?>(fst);
+            var @ref = new BytesRef();
+            var input = new ByteArrayDataInput();
+            return new SortedSetDocValuesAnonymousInnerClassHelper(entry, docToOrds, fst,
@in, firstArc, scratchArc, scratchInts, fstEnum, @ref, input);
         }
 
         private class SortedSetDocValuesAnonymousInnerClassHelper : SortedSetDocValues
         {
-            private readonly Lucene42DocValuesProducer OuterInstance;
-
-            private FSTEntry Entry;
-            private BinaryDocValues DocToOrds;
-            private FST<long?> Fst;
-            private FST<long?>.BytesReader @in;
-            private FST<long?>.Arc<long?> FirstArc;
-            private FST<long?>.Arc<long?> ScratchArc;
-            private IntsRef ScratchInts;
-            private BytesRefFSTEnum<long?> FstEnum;
-            private BytesRef @ref;
-            private ByteArrayDataInput Input;
-
-            public SortedSetDocValuesAnonymousInnerClassHelper(Lucene42DocValuesProducer
outerInstance, FSTEntry entry, BinaryDocValues docToOrds, FST<long?> fst, FST<long?>.BytesReader
@in, FST<long?>.Arc<long?> firstArc, FST<long?>.Arc<long?> scratchArc,
IntsRef scratchInts, BytesRefFSTEnum<long?> fstEnum, BytesRef @ref, ByteArrayDataInput
input)
-            {
-                this.OuterInstance = outerInstance;
+            private readonly FSTEntry Entry;
+            private readonly BinaryDocValues DocToOrds;
+            private readonly FST<long?> Fst;
+            private readonly FST<long?>.BytesReader @in;
+            private readonly FST<long?>.Arc<long?> FirstArc;
+            private readonly FST<long?>.Arc<long?> ScratchArc;
+            private readonly IntsRef ScratchInts;
+            private readonly BytesRefFSTEnum<long?> FstEnum;
+            private readonly BytesRef @ref;
+            private readonly ByteArrayDataInput Input;
+
+            public SortedSetDocValuesAnonymousInnerClassHelper(FSTEntry entry, BinaryDocValues
docToOrds, FST<long?> fst, FST<long?>.BytesReader @in, FST<long?>.Arc<long?>
firstArc, FST<long?>.Arc<long?> scratchArc, IntsRef scratchInts, BytesRefFSTEnum<long?>
fstEnum, BytesRef @ref, ByteArrayDataInput input)
+            {
                 this.Entry = entry;
                 this.DocToOrds = docToOrds;
                 this.Fst = fst;
@@ -603,7 +582,7 @@ namespace Lucene.Net.Codecs.Lucene42
                 this.Input = input;
             }
 
-            internal long currentOrd;
+            private long currentOrd;
 
             public override long NextOrd()
             {
@@ -623,7 +602,7 @@ namespace Lucene.Net.Codecs.Lucene42
                 set
                 {
                     DocToOrds.Get(value, @ref);
-                    Input.Reset((byte[])(Array)@ref.Bytes, @ref.Offset, @ref.Length);
+                    Input.Reset(@ref.Bytes, @ref.Offset, @ref.Length);
                     currentOrd = 0;
                 }
             }
@@ -650,7 +629,7 @@ namespace Lucene.Net.Codecs.Lucene42
             {
                 try
                 {
-                    Lucene.Net.Util.Fst.BytesRefFSTEnum<long?>.InputOutput<long?>
o = FstEnum.SeekCeil(key);
+                    var o = FstEnum.SeekCeil(key);
                     if (o == null)
                     {
                         return -ValueCount - 1;
@@ -751,7 +730,7 @@ namespace Lucene.Net.Codecs.Lucene42
 
             public override BytesRef Next()
             {
-                Lucene.Net.Util.Fst.BytesRefFSTEnum<long?>.InputOutput<long?>
io = @in.Next();
+                var io = @in.Next();
                 if (io == null)
                 {
                     return null;


Mime
View raw message