Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FastResourceComparer.cs
Go to the documentation of this file.
2
3namespace System.Resources;
4
5internal sealed class FastResourceComparer : IComparer<string>, IEqualityComparer<string>
6{
8
9 public int GetHashCode(string key)
10 {
11 return HashFunction(key);
12 }
13
14 internal static int HashFunction(string key)
15 {
16 uint num = 5381u;
17 for (int i = 0; i < key.Length; i++)
18 {
19 num = ((num << 5) + num) ^ key[i];
20 }
21 return (int)num;
22 }
23
24 public int Compare(string a, string b)
25 {
26 return string.CompareOrdinal(a, b);
27 }
28
29 public bool Equals(string a, string b)
30 {
31 return string.Equals(a, b);
32 }
33}
static readonly FastResourceComparer Default