mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 05:59:52 +00:00
8244459: Optimize the hash map size in LocaleProviderAdapters
Reviewed-by: joehw, plevart, smarks
This commit is contained in:
parent
ed24927500
commit
09287ab1ac
@ -225,7 +225,7 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
|
||||
Set<String> tagset = new HashSet<>(Math.max((int)(tokens.countTokens() / 0.75f) + 1, 16));
|
||||
Set<String> tagset = new HashSet<>((tokens.countTokens() * 4 + 2) / 3);
|
||||
while (tokens.hasMoreTokens()) {
|
||||
tagset.add(tokens.nextToken());
|
||||
}
|
||||
|
||||
@ -445,7 +445,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
|
||||
return Collections.emptySet();
|
||||
}
|
||||
StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
|
||||
Set<String> tagset = new HashSet<>(Math.max((int)(tokens.countTokens() / 0.75f) + 1, 16));
|
||||
Set<String> tagset = new HashSet<>((tokens.countTokens() * 4 + 2) / 3);
|
||||
while (tokens.hasMoreTokens()) {
|
||||
tagset.add(tokens.nextToken());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user