[Pharo-project] About FixedIdentitySet
I just noticed this: (FixedIdentitySet withAll: #(a b c)) = #(a a a). I presume that does not matter... FixedIdentitySet also make usage of identityHash - with a basicSize power of two - using bitAnd: rather than modulo (because of the size being power of two, that should be equivalent) I guess it works because used with small size only... Beware not using scaledIdentityHash then ! Shouldn't the read-only version really use an Array, up to a given size greater than 0 or 1 ?
Nicolas Cellier wrote:
I just noticed this:
(FixedIdentitySet withAll: #(a b c)) = #(a a a).
I presume that does not matter...
FixedIdentitySet also make usage of identityHash - with a basicSize power of two - using bitAnd: rather than modulo (because of the size being power of two, that should be equivalent) I guess it works because used with small size only... Beware not using scaledIdentityHash then !
Yes, I noticed that; FixedIdentitySet was the only class other than MethodDictionary that needed to use the unscaled primIdentityHash. I wondered what FixedIdentitySet was used for, it seems like a very odd beast, but I didn't dig into it. Regards, -Martin
participants (2)
-
Martin McClure -
Nicolas Cellier