[Mono-devel-list] Some patches for Collection

Paolo Molaro lupus at ximian.com
Fri Feb 18 10:33:55 EST 2005


On 02/17/05 Jonathan Gilbert wrote:
> At 05:45 PM 17/02/2005 +0100, Martin Baulig wrote:
> >Next week someone comes and relies on Equals() being in the same way
> >broken, but the other way around - should we now keep changing it back
> >and forth each time someone complains ?
[...]
> "If mono's behaviour is different than the Microsoft runtime's behaviour,
> then it is a bug in mono." As much as you may dislike the patches, this
> describes this situation.

The issue here is not really about compatibility with the MS runtime
(which not all of us care about that much), but of correctness and
quality of the code. I just looked at Stack.cs: if someone
does a Push() of a null value, the current Contains() code
will throw a nullref exception. The clear fix is to do what
the patch to Stack.cs does.
In other cases it is a performance issue: the same method will
be called repeatedly, improving cache locality (and potentially
avoiding the need to jit compile other methods).
Kazuki, please commit the changes that reverse the order in the
Equals calls.
Thanks

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list