Instantiate ArrayList class with a exact initial capacity
This commit is contained in:
parent
bc0317af3b
commit
c31613dc74
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -166,7 +166,7 @@ final class PostProcessorRegistrationDelegate {
|
|||
invokeBeanFactoryPostProcessors(priorityOrderedPostProcessors, beanFactory);
|
||||
|
||||
// Next, invoke the BeanFactoryPostProcessors that implement Ordered.
|
||||
List<BeanFactoryPostProcessor> orderedPostProcessors = new ArrayList<>();
|
||||
List<BeanFactoryPostProcessor> orderedPostProcessors = new ArrayList<>(orderedPostProcessorNames.size());
|
||||
for (String postProcessorName : orderedPostProcessorNames) {
|
||||
orderedPostProcessors.add(beanFactory.getBean(postProcessorName, BeanFactoryPostProcessor.class));
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ final class PostProcessorRegistrationDelegate {
|
|||
invokeBeanFactoryPostProcessors(orderedPostProcessors, beanFactory);
|
||||
|
||||
// Finally, invoke all other BeanFactoryPostProcessors.
|
||||
List<BeanFactoryPostProcessor> nonOrderedPostProcessors = new ArrayList<>();
|
||||
List<BeanFactoryPostProcessor> nonOrderedPostProcessors = new ArrayList<>(nonOrderedPostProcessorNames.size());
|
||||
for (String postProcessorName : nonOrderedPostProcessorNames) {
|
||||
nonOrderedPostProcessors.add(beanFactory.getBean(postProcessorName, BeanFactoryPostProcessor.class));
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ final class PostProcessorRegistrationDelegate {
|
|||
registerBeanPostProcessors(beanFactory, priorityOrderedPostProcessors);
|
||||
|
||||
// Next, register the BeanPostProcessors that implement Ordered.
|
||||
List<BeanPostProcessor> orderedPostProcessors = new ArrayList<>();
|
||||
List<BeanPostProcessor> orderedPostProcessors = new ArrayList<>(orderedPostProcessorNames.size());
|
||||
for (String ppName : orderedPostProcessorNames) {
|
||||
BeanPostProcessor pp = beanFactory.getBean(ppName, BeanPostProcessor.class);
|
||||
orderedPostProcessors.add(pp);
|
||||
|
@ -235,7 +235,7 @@ final class PostProcessorRegistrationDelegate {
|
|||
registerBeanPostProcessors(beanFactory, orderedPostProcessors);
|
||||
|
||||
// Now, register all regular BeanPostProcessors.
|
||||
List<BeanPostProcessor> nonOrderedPostProcessors = new ArrayList<>();
|
||||
List<BeanPostProcessor> nonOrderedPostProcessors = new ArrayList<>(nonOrderedPostProcessorNames.size());
|
||||
for (String ppName : nonOrderedPostProcessorNames) {
|
||||
BeanPostProcessor pp = beanFactory.getBean(ppName, BeanPostProcessor.class);
|
||||
nonOrderedPostProcessors.add(pp);
|
||||
|
|
Loading…
Reference in New Issue