Browse Source

Remove unnecessary mem alloc in CollectingReaderEventListener

Closes gh-24799
pull/24800/head
Qimiao Chen 6 years ago committed by GitHub
parent
commit
c77853b766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/CollectingReaderEventListener.java

4
spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/CollectingReaderEventListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2020 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.
@ -65,7 +65,7 @@ public class CollectingReaderEventListener implements ReaderEventListener { @@ -65,7 +65,7 @@ public class CollectingReaderEventListener implements ReaderEventListener {
public ComponentDefinition[] getComponentDefinitions() {
Collection<ComponentDefinition> collection = this.componentDefinitions.values();
return collection.toArray(new ComponentDefinition[collection.size()]);
return collection.toArray(new ComponentDefinition[0]);
}
@Override

Loading…
Cancel
Save