Answer the question
In order to leave comments, you need to log in
I'm looking at Java sources: HashMap bucket implementation - why is HashCode "hashed" again?
I looked at the implementation of HashMap in the Java sources and this is what I saw:
private static int hash(Object x, int length) {
int h = System.identityHashCode(x);
// Multiply by -127, and left-shift to use least bit as part of hash
return ((h << 1) - (h << 8)) & (length - 1);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question