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

Comparing jsr166/src/main/java/util/HashMap.java (file contents):
Revision 1.9 by jsr166, Sun Nov 11 16:27:28 2018 UTC vs.
Revision 1.10 by jsr166, Tue Dec 18 20:21:24 2018 UTC

# Line 501 | Line 501 | public class HashMap<K,V> extends Abstra
501                           (int)ft : MAXIMUM_CAPACITY);
502                  if (t > threshold)
503                      threshold = tableSizeFor(t);
504 +            } else {
505 +                // Because of linked-list bucket constraints, we cannot
506 +                // expand all at once, but can reduce total resize
507 +                // effort by repeated doubling now vs later
508 +                while (s > threshold && table.length < MAXIMUM_CAPACITY)
509 +                    resize();
510              }
511 <            else if (s > threshold)
506 <                resize();
511 >
512              for (Map.Entry<? extends K, ? extends V> e : m.entrySet()) {
513                  K key = e.getKey();
514                  V value = e.getValue();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines