Remove unnecessary mem alloc in CollectingReaderEventListener

Closes gh-24799
This commit is contained in:
Qimiao Chen 2020-03-27 18:00:05 +08:00 committed by GitHub
parent a606fb4b21
commit c77853b766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -65,7 +65,7 @@ public class CollectingReaderEventListener implements ReaderEventListener {
public ComponentDefinition[] getComponentDefinitions() { public ComponentDefinition[] getComponentDefinitions() {
Collection<ComponentDefinition> collection = this.componentDefinitions.values(); Collection<ComponentDefinition> collection = this.componentDefinitions.values();
return collection.toArray(new ComponentDefinition[collection.size()]); return collection.toArray(new ComponentDefinition[0]);
} }
@Override @Override