IdentityHashMap & natStackTrace
Fri Nov 26 16:50:00 GMT 2004
Bryce McKinlay writes:
> Ranjit Mathew wrote:
> >As Chris points, due to operator precedence weirdness this
> >becomes a left shift by 3 or multiplication by 23, in line
> >with what you observed.
> >This was introduced almost two years ago in a merge from
> >Relevant change:
> > // This isn't necessarily prime, but it is an odd number of key/value
> > // slots, which has a higher probability of fewer collisions.
> >- table = new Object[old.length * 2 + 2];
> >+ table = new Object[old.length << 1 + 2];
> I'd like to make a plea to Classpath developers not to make this kind of
> change in the future. Not only does the new code introduce a bug, it is
> also more difficult to read, and it won't make any performance
> difference on any modern compiler.
Not only that, it won't make any difference on an old interpreter!
More information about the Java