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
|
@ -744,8 +744,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
|
|||
* 0.75 - the default load factor of HashMap
|
||||
*/
|
||||
private static final int NUM_ENTITIES = 737;
|
||||
private static Map<String, UnicodeBlock> map =
|
||||
new HashMap<>((int)(NUM_ENTITIES / 0.75f + 1.0f));
|
||||
private static Map<String, UnicodeBlock> map = HashMap.newHashMap(NUM_ENTITIES);
|
||||
|
||||
/**
|
||||
* Creates a UnicodeBlock with the given identifier name.
|
||||
|
@ -8572,7 +8571,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
|
|||
|
||||
private static final HashMap<String, Character.UnicodeScript> aliases;
|
||||
static {
|
||||
aliases = new HashMap<>((int)(162 / 0.75f + 1.0f));
|
||||
aliases = HashMap.newHashMap(162);
|
||||
aliases.put("ADLM", ADLAM);
|
||||
aliases.put("AGHB", CAUCASIAN_ALBANIAN);
|
||||
aliases.put("AHOM", AHOM);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue