Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
OrdinalIgnoreCaseComparer.cs
Go to the documentation of this file.
3
4namespace System;
5
8{
10
13 {
14 }
15
16 public override int Compare(string x, string y)
17 {
18 return string.Compare(x, y, StringComparison.OrdinalIgnoreCase);
19 }
20
21 public override bool Equals(string x, string y)
22 {
23 if ((object)x == y)
24 {
25 return true;
26 }
27 if (x == null || y == null)
28 {
29 return false;
30 }
31 if (x.Length != y.Length)
32 {
33 return false;
34 }
35 return System.Globalization.Ordinal.EqualsIgnoreCase(ref x.GetRawStringData(), ref y.GetRawStringData(), x.Length);
36 }
37
38 public override int GetHashCode(string obj)
39 {
40 if (obj == null)
41 {
43 }
44 return obj.GetHashCodeOrdinalIgnoreCase();
45 }
46
48 {
49 info.SetType(typeof(OrdinalComparer));
50 info.AddValue("_ignoreCase", value: true);
51 }
52}
static bool EqualsIgnoreCase(ref char charA, ref char charB, int length)
Definition Ordinal.cs:57
override int Compare(string x, string y)
void GetObjectData(SerializationInfo info, StreamingContext context)
override bool Equals(string x, string y)
static readonly OrdinalIgnoreCaseComparer Instance
static void ThrowArgumentNullException(string name)