mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8186958: Need method to create pre-sized HashMap
Reviewed-by: chegar, naoto, joehw, lancea, wetmore, smarks
This commit is contained in:
parent
41fc078323
commit
87faa85c59
30 changed files with 208 additions and 73 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -290,7 +290,7 @@ abstract class MethodHandleImpl {
|
|||
BoundMethodHandle mh = target.rebind();
|
||||
|
||||
// Match each unique conversion to the positions at which it is to be applied
|
||||
var convSpecMap = new HashMap<Object, int[]>(((4 * convCount) / 3) + 1);
|
||||
HashMap<Object, int[]> convSpecMap = HashMap.newHashMap(convCount);
|
||||
for (int i = 0; i < convSpecs.length - MH_RECEIVER_OFFSET; i++) {
|
||||
Object convSpec = convSpecs[i];
|
||||
if (convSpec == null) continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue