< prev index next >

src/java.base/share/classes/java/util/WeakHashMap.java

Print this page
rev 51093 : imported patch 8207314-Unnecessary-reallocation-when-constructing-WeakHashMap-from-a-large-Map

@@ -250,11 +250,11 @@
      * @param   m the map whose mappings are to be placed in this map
      * @throws  NullPointerException if the specified map is null
      * @since   1.3
      */
     public WeakHashMap(Map<? extends K, ? extends V> m) {
-        this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1,
+        this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR + 1),
                 DEFAULT_INITIAL_CAPACITY),
              DEFAULT_LOAD_FACTOR);
         putAll(m);
     }
 
< prev index next >