public FixList Add(string key, SpellingFix fix) { if (Items.TryGetValue(key, out ImmutableHashSet <SpellingFix>?fixes)) { if (fixes.Contains(fix)) { return(this); } fixes = fixes.Add(fix); ImmutableDictionary <string, ImmutableHashSet <SpellingFix> > values = Items.SetItem(key, fixes); return(new FixList(values)); } else { fixes = ImmutableHashSet.Create(SpellingFixComparer.InvariantCultureIgnoreCase, fix); ImmutableDictionary <string, ImmutableHashSet <SpellingFix> > dic = Items.Add(key, fixes); return(new FixList(dic)); } }
public override int Compare(SpellingFix x, SpellingFix y) { return(StringComparer.CurrentCulture.Compare(x.Value, y.Value)); }
public override int GetHashCode(SpellingFix obj) { return(WordList.DefaultComparer.GetHashCode(obj.Value)); }
public override bool Equals(SpellingFix x, SpellingFix y) { return(WordList.DefaultComparer.Equals(x.Value, y.Value)); }
public override int Compare(SpellingFix x, SpellingFix y) { return(WordList.DefaultComparer.Compare(x.Value, y.Value)); }
public override int GetHashCode(SpellingFix obj) { return(StringComparer.CurrentCulture.GetHashCode(obj.Value)); }
public override bool Equals(SpellingFix x, SpellingFix y) { return(StringComparer.CurrentCulture.Equals(x.Value, y.Value)); }