Skip to content
No description, website, or topics provided.
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
FastDictionaryComparer.Benchmark
FastDictionaryComparer.Test
FastDictionaryComparer
assets
.gitignore
FastDictionaryComparer.sln
LICENSE
README.md
appveyor.yml

README.md

logo

appveyor status NuGet

Compare dictionaries in performant way, much faster than using linq.

Installing

Simple use example

var set = Enumerable.Range(0, 10).Select(i => new Dictionary<string, string> { { "key1", i.ToString() }, { "key2", i.ToString() } });

var toFind = new Dictionary<string, string> { { "key1", "1" } };

var factory = new EquatableDictionaryFactory<string, string>(set.Concat(new[] { toFind1, toFind2, toFind3, toFind4 }).ToArray());

Assert.Contains(factory.CreateEquatableOneOfDictionary(toFind1), set.Select(factory.CreateEquatableOneOfDictionary)); // It's true

Api

public EquatableDictionaryFactory(Dictionary<T, Y>[] dicts, IEqualityComparer<T> keyEqualityComparer = null, IEqualityComparer<Y> valueEqualityComparer = null);

// EquatableDictionaryFactory methods
public EquatableDictionaryOneOf<T, Y> CreateEquatableOneOfDictionary(Dictionary<T, Y> dict);
public EquatableDictionaryAllOf<T, Y> CreateEquatableAllOfDictionary(Dictionary<T, Y> dict);

EquatableDictionaryOneOf

One of key-value pairs should match to consider two dictionaries being equal.

EquatableDictionaryAllOf

All of key-value pairs should match to consider two dictionaries being equal.

Benchmark

benchmark

See FastDictionaryComparer.Benchmark/Program.cs

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

You can’t perform that action at this time.