153 |
|
* differ in lower bits. |
154 |
|
*/ |
155 |
|
private static int hash(int h) { |
156 |
< |
// This function ensures that hashCodes that differ only by |
157 |
< |
// constant multiples at each bit position have a bounded |
158 |
< |
// number of collisions (approximately 8 at default load factor). |
159 |
< |
h ^= (h >>> 20) ^ (h >>> 12); |
160 |
< |
return h ^ (h >>> 7) ^ (h >>> 4); |
156 |
> |
// Spread bits to regularize both segment and index locations, |
157 |
> |
// using variant of Jenkins's shift-based hash. |
158 |
> |
h += ~(h << 13); |
159 |
> |
h ^= h >>> 7; |
160 |
> |
h += h << 3; |
161 |
> |
h ^= h >>> 17; |
162 |
> |
h += h << 5; |
163 |
> |
return h; |
164 |
|
} |
165 |
|
|
166 |
|
/** |