You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The algorithm assumes the two dictionaries are sorted in the same order. This is not the behavior you would expect since it depends on the IDictionary implementation. Two implementations with the same contents can easily compare different.
Ice C# also provides HashCode computation for these dictionaries that is also order-dependent (that's consistent with Equal, which is good). IceRPC doesn't provide a HashCode implementation. It's not obvious how to provide a correct order-independent HashCode implementation. A simple solution is to hash the size of the dictionary, not its contents.
The text was updated successfully, but these errors were encountered:
In C#, we check if two dictionaries are equal using:
ice/csharp/src/Ice/Collections.cs
Line 103 in 711bb29
The algorithm assumes the two dictionaries are sorted in the same order. This is not the behavior you would expect since it depends on the IDictionary implementation. Two implementations with the same contents can easily compare different.
IceRPC C# provides an order-independent implementation of DictionaryEqual:
https://github.com/icerpc/icerpc-csharp/blob/57995b702436169798fc3fe5fd513e6f09591397/src/IceRpc/Internal/DictionaryExtensions.cs#L10
Ice C# also provides HashCode computation for these dictionaries that is also order-dependent (that's consistent with Equal, which is good). IceRPC doesn't provide a HashCode implementation. It's not obvious how to provide a correct order-independent HashCode implementation. A simple solution is to hash the size of the dictionary, not its contents.
The text was updated successfully, but these errors were encountered: