- SqlLinq_src.zip
- SqlLinq_src
- GoldParser.dll
- Kackman.RuntimeTypeLoader.dll
- LinqStatistics.dll
- QueryAnything.UnitTests
- SQL-ANSI-89.4.grm
- SQlLinq.sln
- SQlLinq.vsmdi
- SQlLinq.vssscc
- SqlLinq
- TestSettings2.testsettings
- queryanything_src.zip
- QueryAnything_src
- GoldParser.dll
- Kackman.RuntimeTypeLoader.dll
- LinqStatistics.UnitTests
- LinqStatistics
- Local.testsettings
- mssccprj.scc
- QueryAnything.UnitTests
- QueryAnything
- SQL-ANSI-89.4.grm
- SqlLinq.sln
- SqlLinq.vsmdi
- SqlLinq.vssscc
- SqlLinq
- TraceAndTestImpact.testsettings
- vssver2.scc
- SqlLinq_src3.zip
- SqlLinq_src2.zip
|
using System.Collections.Generic;
namespace SqlLinq
{
class DictionaryComparer<TKey, TValue> : IEqualityComparer<IDictionary<TKey, TValue>>
{
public DictionaryComparer()
{
}
public bool Equals(IDictionary<TKey, TValue> x, IDictionary<TKey, TValue> y)
{
if (x.Count != y.Count)
return false;
return GetHashCode(x) == GetHashCode(y);
}
public int GetHashCode(IDictionary<TKey, TValue> obj)
{
int hash = 0;
unchecked
{
Dictionary<TKey, TValue> d = obj as Dictionary<TKey, TValue>;
IEqualityComparer<TKey> comparer = d != null ? d.Comparer : EqualityComparer<TKey>.Default;
foreach (KeyValuePair<TKey, TValue> pair in obj)
{
int key = comparer.GetHashCode(pair.Key);
int value = pair.Value != null ? pair.Value.GetHashCode() : 0;
hash ^= key ^ value;
}
}
return hash;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
The first computer program I ever wrote was in BASIC on a TRS-80 Model I and it looked something like:
10 PRINT "Don is cool"
20 GOTO 10
It only went downhill from there.
Hey look, I've got a blog