Le 30 déc. 2014 13:13, "Clément Bera" <[email protected]> a écrit : > > Hello Pharoers, > > I was wondering, is it a good practice to have negative hashes ? > > Based on the class comment of Object>>#hash > > "Answer a SmallInteger whose value is related to the receiver's identity. [...]" > > The hash is a smallInteger and therefore can be negative.
Why would this be a poor practice if seen as a set of bits? As long as it does its job for identifying buckets, it looks okay to me. More bits with good spreading is more space for the hashes. Now hash should be redefined along with equals if we run into large sets to limit collisions. And I guess we wouldn't keep SmallInteger then. Why the question? Phil > > Thanks for any answer. > > Clement
