Remove stream in hot path of capability provider construction
This commit is contained in:
parent
f931d5c442
commit
864c751aea
|
|
@ -94,9 +94,10 @@ public class CapabilityProviderDispatcherGenerator {
|
||||||
* Convenience method that takes an array of providers and returns the constructor.
|
* Convenience method that takes an array of providers and returns the constructor.
|
||||||
*/
|
*/
|
||||||
private static MethodHandle getOrGenerateConstructor(ICapabilityProvider[] providers) {
|
private static MethodHandle getOrGenerateConstructor(ICapabilityProvider[] providers) {
|
||||||
List<Class<? extends ICapabilityProvider>> types = Arrays.stream(providers)
|
List<Class<? extends ICapabilityProvider>> types = new ArrayList<>(providers.length);
|
||||||
.<Class<? extends ICapabilityProvider>>map(ICapabilityProvider::getClass)
|
for (ICapabilityProvider provider : providers) {
|
||||||
.toList();
|
types.add(provider.getClass());
|
||||||
|
}
|
||||||
return getOrGenerateConstructor(types);
|
return getOrGenerateConstructor(types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user