[Newbies] Re: Somthing weird in Set
Hilaire Fernandes
hilaire at ofset.org
Fri Dec 14 19:44:43 UTC 2007
nicolas cellier a écrit :
> It can happen most probably due to problems of hash code.
> Two objects that are equal SHOULD have same hash code.
> - either YourObject does define #= but does not define #hash
> - or you add theObject to theSet, then modify theObject, which has side
> effect of modifying its hash code, and then theObject cannot be found in
> theSet (in which case you have a cure: theSet rehash)
Oh, yes it is exactly what it is happening, for odd reason I update the
hash value of the inserted object
Thanks
Hilaire
More information about the Beginners
mailing list