ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.91 by jsr166, Thu Jun 22 05:23:32 2006 UTC vs.
Revision 1.92 by dl, Sat Dec 2 20:55:01 2006 UTC

# Line 153 | Line 153 | public class ConcurrentHashMap<K, V> ext
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      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines