diff options
author | Anatoliy Sablin | 2017-10-18 23:02:33 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-10-19 09:49:42 +0300 |
commit | 90f5ed89067c49051974e1905c4b2b3c93336b1c (patch) | |
tree | 27d236885ab37f28de57cf33e2bd5e99bef078de /juick-ws/src/main/java/com/juick/ws | |
parent | 48c15e2162781a57868d690339b8bede137fbbde (diff) |
Replaced the ArrayList by the LinkedList to avoid overhead array copying when the list is increased.
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/WebsocketComponent.java | 4 |
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; |