Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep resources in ArrayList instead of LinkedList for performance reasons #4297

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Work with array list instead of list for performance reasons
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
senivam committed Oct 18, 2019
commit 421c25babf43626655cd404435c49aec7593e49d
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ public static final class Builder {
private Builder(final Resource.Builder parentResource) {
this.methodBuilders = new LinkedHashSet<>();
this.childResourceBuilders = new LinkedHashSet<>();
this.childResources = new LinkedList<>();
this.childResources = new ArrayList<>();
this.resourceMethods = new LinkedList<>();
this.handlerClasses = Collections.newSetFromMap(new IdentityHashMap<>());
this.handlerInstances = Collections.newSetFromMap(new IdentityHashMap<>());
@@ -542,7 +542,7 @@ private void onBuildChildResource(Builder childResourceBuilder, Resource.Data ch

}

private List<Resource.Data> mergeResources(List<Resource.Data> resources) {
private static List<Resource.Data> mergeResources(List<Resource.Data> resources) {
List<Resource.Data> mergedResources = new ArrayList<>();
for (int i = 0; i < resources.size(); i++) {
Resource.Data outer = resources.get(i);