X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FMono.Globalization.Unicode%2FSortKeyBuffer.cs;h=61e909aa1d97f15ca49ce1134e0f70ad909265b9;hb=68069f056621ebdafa21ae4e75e75f6e83b7202a;hp=46b69817c0eb23164edfc3caf7cbc145914ca5fe;hpb=04d1b4116331e3813b8f75304f714a5d61ba1214;p=mono.git diff --git a/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs b/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs index 46b69817c0e..61e909aa1d9 100644 --- a/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs +++ b/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs @@ -37,16 +37,16 @@ namespace Mono.Globalization.Unicode { // l4s = small kana sensitivity, l4t = mark type, // l4k = katakana flag, l4w = kana width sensitivity - int l1, l2, l3, l4s, l4t, l4k, l4w, l5; byte [] l1b, l2b, l3b, l4sb, l4tb, l4kb, l4wb, l5b; - int level5LastPos; +// int level5LastPos; string source; + int l1, l2, l3, l4s, l4t, l4k, l4w, l5; + int lcid; + CompareOptions options; bool processLevel2; bool frenchSort; bool frenchSorted; - int lcid; - CompareOptions options; public SortKeyBuffer (int lcid) { @@ -55,7 +55,7 @@ namespace Mono.Globalization.Unicode public void Reset () { l1 = l2 = l3 = l4s = l4t = l4k = l4w = l5 = 0; - level5LastPos = 0; +// level5LastPos = 0; frenchSorted = false; } @@ -195,7 +195,7 @@ namespace Mono.Globalization.Unicode AppendBufferPrimitive ((byte) ((offsetValue / 64) + 0x80), ref l5b, ref l5); AppendBufferPrimitive ((byte) (offsetValue % 64 * 4 + 3), ref l5b, ref l5); - level5LastPos = l2; +// level5LastPos = l2; // sortkey value AppendBufferPrimitive (category, ref l5b, ref l5); @@ -234,7 +234,10 @@ namespace Mono.Globalization.Unicode public SortKey GetResult () { - if (frenchSort && !frenchSorted) { + if (source.Length == 0) + return new SortKey (lcid, source, new byte [0], options, 0, 0, 0, 0, 0, 0, 0, 0); + + if (frenchSort && !frenchSorted && l2b != null) { int i = 0; for (; i < l2b.Length; i++) if (l2b [i] == 0)