DeterministicStringKey.cs
1 using System; 2 3 namespace Spv.Generator 4 { 5 internal class DeterministicStringKey : IEquatable<DeterministicStringKey> 6 { 7 private readonly string _value; 8 9 public DeterministicStringKey(string value) 10 { 11 _value = value; 12 } 13 14 public override int GetHashCode() 15 { 16 return DeterministicHashCode.GetHashCode(_value); 17 } 18 19 public bool Equals(DeterministicStringKey other) 20 { 21 return _value == other?._value; 22 } 23 24 public override bool Equals(object obj) 25 { 26 return obj is DeterministicStringKey key && Equals(key); 27 } 28 } 29 }