Lucene.Net.Analysis.Common.Analysis.Compound.Hyphenation: converted sbyte to byte for CLS compliance
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/fb767582 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/fb767582 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/fb767582 Branch: refs/heads/api-work Commit: fb767582411fb50dd272d07bf8d97ca877b73891 Parents: 19f2299 Author: Shad Storhaug <[email protected]> Authored: Wed Feb 1 18:34:18 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Feb 1 18:48:07 2017 +0700 ---------------------------------------------------------------------- .../Analysis/Compound/Hyphenation/ByteVector.cs | 16 ++++++------- .../Compound/Hyphenation/HyphenationTree.cs | 24 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fb767582/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/ByteVector.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/ByteVector.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/ByteVector.cs index 7f00460..206a7c4 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/ByteVector.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/ByteVector.cs @@ -38,7 +38,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation /// <summary> /// The encapsulated array /// </summary> - private sbyte[] array; + private byte[] array; /// <summary> /// Points to next free item @@ -60,18 +60,18 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation { blockSize = DEFAULT_BLOCK_SIZE; } - array = new sbyte[blockSize]; + array = new byte[blockSize]; n = 0; } - public ByteVector(sbyte[] a) + public ByteVector(byte[] a) { blockSize = DEFAULT_BLOCK_SIZE; array = a; n = 0; } - public ByteVector(sbyte[] a, int capacity) + public ByteVector(byte[] a, int capacity) { if (capacity > 0) { @@ -87,7 +87,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation [WritableArray] [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] - public virtual sbyte[] Array + public virtual byte[] Array { get { @@ -100,7 +100,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation /// </summary> /// <param name="index"></param> /// <returns></returns> - public virtual sbyte this[int index] + public virtual byte this[int index] { get { return array[index]; } set { array[index] = value; } @@ -141,7 +141,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation int len = array.Length; if (n + size >= len) { - sbyte[] aux = new sbyte[len + blockSize]; + byte[] aux = new byte[len + blockSize]; System.Array.Copy(array, 0, aux, 0, len); array = aux; } @@ -153,7 +153,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation { if (n < array.Length) { - sbyte[] aux = new sbyte[n]; + byte[] aux = new byte[n]; System.Array.Copy(array, 0, aux, 0, n); array = aux; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fb767582/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/HyphenationTree.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/HyphenationTree.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/HyphenationTree.cs index 20c255d..7e1420d 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/HyphenationTree.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/HyphenationTree.cs @@ -76,18 +76,18 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation int i, n = values.Length; int m = (n & 1) == 1 ? (n >> 1) + 2 : (n >> 1) + 1; int offset = m_vspace.Alloc(m); - sbyte[] va = m_vspace.Array; + byte[] va = m_vspace.Array; for (i = 0; i < n; i++) { int j = i >> 1; - sbyte v = (sbyte)((values[i] - '0' + 1) & 0x0f); + byte v = (byte)((values[i] - '0' + 1) & 0x0f); if ((i & 1) == 1) { - va[j + offset] = (sbyte)(va[j + offset] | v); + va[j + offset] = (byte)(va[j + offset] | v); } else { - va[j + offset] = (sbyte)(v << 4); // big endian + va[j + offset] = (byte)(v << 4); // big endian } } va[m - 1 + offset] = 0; // terminator @@ -97,7 +97,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation protected internal virtual string UnpackValues(int k) { StringBuilder buf = new StringBuilder(); - sbyte v = m_vspace[k++]; + byte v = m_vspace[k++]; while (v != 0) { char c = (char)(((int)((uint)v >> 4)) - 1 + '0'); @@ -236,10 +236,10 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation return s[si] - t[ti]; } - protected internal virtual sbyte[] GetValues(int k) + protected internal virtual byte[] GetValues(int k) { StringBuilder buf = new StringBuilder(); - sbyte v = m_vspace[k++]; + byte v = m_vspace[k++]; while (v != 0) { char c = (char)((((int)((uint)v >> 4))) - 1); @@ -253,10 +253,10 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation buf.Append(c); v = m_vspace[k++]; } - sbyte[] res = new sbyte[buf.Length]; + byte[] res = new byte[buf.Length]; for (int i = 0; i < res.Length; i++) { - res[i] = (sbyte)buf[i]; + res[i] = (byte)buf[i]; } return res; } @@ -286,9 +286,9 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation /// <param name="word"> null terminated word to match </param> /// <param name="index"> start index from word </param> /// <param name="il"> interletter values array to update </param> - protected internal virtual void SearchPatterns(char[] word, int index, sbyte[] il) + protected internal virtual void SearchPatterns(char[] word, int index, byte[] il) { - sbyte[] values; + byte[] values; int i = index; char p, q; char sp = word[i]; @@ -484,7 +484,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation word[0] = '.'; // word start marker word[len + 1] = '.'; // word end marker word[len + 2] = (char)0; // null terminated - sbyte[] il = new sbyte[len + 3]; // initialized to zero + byte[] il = new byte[len + 3]; // initialized to zero for (i = 0; i < len + 1; i++) { SearchPatterns(word, i, il);
