23 using System.Collections.Generic;
27 namespace Lucene.Net.Index.Memory
35 public static int KeyComparer<TKey, TValue>(KeyValuePair<TKey, TValue> x, KeyValuePair<TKey, TValue> y)
36 where TKey :
class, IComparable<TKey>
38 if (x.Key == y.Key)
return 0;
39 return typeof (TKey) == typeof (
string)
40 ?
string.Compare(x.Key as
string, y.Key as
string, StringComparison.Ordinal)
41 : x.Key.CompareTo(y.Key);
47 public int Compare(KeyValuePair<string, T> x, KeyValuePair<string, T> y)
49 return KeyComparer(x, y);