mscorlib(4.0.0.0) API with additions
BackCompatibleStringComparer.cs
2 {
3  internal class BackCompatibleStringComparer : IEqualityComparer
4  {
5  internal static IEqualityComparer Default = new BackCompatibleStringComparer();
6 
7  internal BackCompatibleStringComparer()
8  {
9  }
10 
11  public unsafe static int GetHashCode(string obj)
12  {
13  fixed (char* ptr = obj)
14  {
15  int num = 5381;
16  char* ptr2 = ptr;
17  int num2;
18  while ((num2 = *ptr2) != 0)
19  {
20  num = (((num << 5) + num) ^ num2);
21  ptr2++;
22  }
23  return num;
24  }
25  }
26 
27  bool IEqualityComparer.Equals(object a, object b)
28  {
29  return object.Equals(a, b);
30  }
31 
32  public virtual int GetHashCode(object o)
33  {
34  string text = o as string;
35  if (text == null)
36  {
37  return o.GetHashCode();
38  }
39  return GetHashCode(text);
40  }
41  }
42 }
new bool Equals(object x, object y)
Determines whether the specified objects are equal.
Defines methods to support the comparison of objects for equality.
The default setting for this enumeration, which is currently F:System.GCCollectionMode....