mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8207314: Unnecessary reallocation when constructing WeakHashMap from a large Map
Reviewed-by: martin
This commit is contained in:
parent
2f4efb7871
commit
ad816a0809
1 changed files with 1 additions and 1 deletions
|
@ -252,7 +252,7 @@ public class WeakHashMap<K,V>
|
|||
* @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) ((float)m.size() / DEFAULT_LOAD_FACTOR + 1.0F),
|
||||
DEFAULT_INITIAL_CAPACITY),
|
||||
DEFAULT_LOAD_FACTOR);
|
||||
putAll(m);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue