Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8246047: Replace LinkedList impl in net.http.websocket.BuilderImpl
Replaced usages of LinkedList with ArrayList in http.websocket.BuilderImpl

Reviewed-by: chegar, dfuchs
  • Loading branch information
c-cleary authored and pconcannon committed Aug 19, 2020
1 parent dd8d78a commit 8eed9aad77d2440e0bf3e06eac86efeef3495901
Showing 1 changed file with 3 additions and 3 deletions.
@@ -35,7 +35,7 @@
import java.net.URI;
import java.time.Duration;
import java.util.Collection;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
@@ -56,7 +56,7 @@ public final class BuilderImpl implements Builder {
public BuilderImpl(HttpClient client, ProxySelector proxySelector)
{
this(client, null, null, Optional.ofNullable(proxySelector),
new LinkedList<>(), new LinkedList<>(), null);
new ArrayList<>(), new ArrayList<>(), null);
}

private BuilderImpl(HttpClient client,
@@ -92,7 +92,7 @@ public Builder subprotocols(String mostPreferred, String... lesserPreferred)
{
requireNonNull(mostPreferred, "mostPreferred");
requireNonNull(lesserPreferred, "lesserPreferred");
List<String> subprotocols = new LinkedList<>();
List<String> subprotocols = new ArrayList<>(lesserPreferred.length + 1);
subprotocols.add(mostPreferred);
for (int i = 0; i < lesserPreferred.length; i++) {
String p = lesserPreferred[i];

0 comments on commit 8eed9aa

Please sign in to comment.