mirror of
https://github.com/lightbend/config.git
synced 2025-03-22 23:30:27 +08:00
Performance fix: added capacity parameter in ArrayLists contructor when adding elements
This commit is contained in:
parent
ab890103dd
commit
44daaf87fa
@ -59,7 +59,7 @@ final class ConfigParser {
|
|||||||
if (flavor == ConfigSyntax.JSON)
|
if (flavor == ConfigSyntax.JSON)
|
||||||
throw new ConfigException.BugOrBroken("Found a concatenation node in JSON");
|
throw new ConfigException.BugOrBroken("Found a concatenation node in JSON");
|
||||||
|
|
||||||
List<AbstractConfigValue> values = new ArrayList<AbstractConfigValue>();
|
List<AbstractConfigValue> values = new ArrayList<AbstractConfigValue>(n.children().size());
|
||||||
|
|
||||||
for (AbstractConfigNode node : n.children()) {
|
for (AbstractConfigNode node : n.children()) {
|
||||||
AbstractConfigValue v = null;
|
AbstractConfigValue v = null;
|
||||||
|
@ -364,7 +364,7 @@ final class SimpleConfigOrigin implements ConfigOrigin {
|
|||||||
Iterator<? extends ConfigOrigin> i = stack.iterator();
|
Iterator<? extends ConfigOrigin> i = stack.iterator();
|
||||||
return mergeTwo((SimpleConfigOrigin) i.next(), (SimpleConfigOrigin) i.next());
|
return mergeTwo((SimpleConfigOrigin) i.next(), (SimpleConfigOrigin) i.next());
|
||||||
} else {
|
} else {
|
||||||
List<SimpleConfigOrigin> remaining = new ArrayList<SimpleConfigOrigin>();
|
List<SimpleConfigOrigin> remaining = new ArrayList<SimpleConfigOrigin>(stack.size());
|
||||||
for (ConfigOrigin o : stack) {
|
for (ConfigOrigin o : stack) {
|
||||||
remaining.add((SimpleConfigOrigin) o);
|
remaining.add((SimpleConfigOrigin) o);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user