aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src
diff options
context:
space:
mode:
authorGravatar Anatoliy Sablin2017-10-18 23:02:33 +0300
committerGravatar Vitaly Takmazov2017-10-19 09:49:42 +0300
commit90f5ed89067c49051974e1905c4b2b3c93336b1c (patch)
tree27d236885ab37f28de57cf33e2bd5e99bef078de /juick-ws/src
parent48c15e2162781a57868d690339b8bede137fbbde (diff)
Replaced the ArrayList by the LinkedList to avoid overhead array copying when the list is increased.
Diffstat (limited to 'juick-ws/src')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java b/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java
index 550067b7..bdf6dba6 100644
--- a/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java
+++ b/juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java
@@ -44,8 +44,8 @@ import javax.inject.Inject;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
-import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
/**
@@ -54,7 +54,7 @@ import java.util.List;
public class WebsocketComponent extends TextWebSocketHandler implements ProtocolListener {
private static final Logger logger = LoggerFactory.getLogger(WebsocketComponent.class);
- private final List<SocketSubscribed> clients = Collections.synchronizedList(new ArrayList<SocketSubscribed>());
+ private final List<SocketSubscribed> clients = Collections.synchronizedList(new LinkedList<>());
@Inject
private UserService userService;