mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8244459: Optimize the hash map size in LocaleProviderAdapters
Reviewed-by: joehw, plevart, smarks
This commit is contained in:
parent
ed24927500
commit
09287ab1ac
2 changed files with 2 additions and 2 deletions
|
@ -225,7 +225,7 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
|
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()) {
|
while (tokens.hasMoreTokens()) {
|
||||||
tagset.add(tokens.nextToken());
|
tagset.add(tokens.nextToken());
|
||||||
}
|
}
|
||||||
|
|
|
@ -445,7 +445,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
|
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()) {
|
while (tokens.hasMoreTokens()) {
|
||||||
tagset.add(tokens.nextToken());
|
tagset.add(tokens.nextToken());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue