[Quickfix-developers] Equals and Hashcode for fields in Quickfix.NET
Brought to you by:
orenmnero
From: Staffan U. <sta...@mu...> - 2007-05-21 00:56:41
|
Hello, I started using Quickfix.NET a while ago, and have stumbled on a problem: The Equals() and GetHashCode() methods do not seem to return reasonable values. I'm using 1.12.4. Surprisingly, the following is to be found in the NEWS file: 1.12.2 ------ [...] Fixed Equals method for Field in .NET. Added Equals and GetHashCode implementations for SessionID. I changed this in Field.::Equals (Field.h): if( !object->GetType()->Equals(__typeof(Field)) ) return false; into if( !object->GetType()->Equals(GetType()) ) return false; and also changed this in Field::GetHashCode (same file): return Object::GetHashCode(); into return ToString()->GetHashCode(); and now it seems to work. Do I somehow mess around with the wrong sources? I can hardly believe this bug has been around for months without anyone noticing... Staffan |