Skip to content

Commit

Permalink
ConcurrentHashSet is redundant with ConcurrentHashMap#newKeySet() #48…
Browse files Browse the repository at this point in the history
…51 (#243)
  • Loading branch information
magicprinc authored Sep 14, 2023
1 parent 3a64003 commit 0fb6d39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/test/java/io/vertx/mqtt/test/server/MqttServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.impl.ConcurrentHashSet;
import io.vertx.core.impl.logging.Logger;
import io.vertx.core.impl.logging.LoggerFactory;
import io.vertx.ext.unit.TestContext;
Expand Down Expand Up @@ -81,7 +80,7 @@ public void sharedServersRoundRobin(TestContext context) {
int numConnections = numServers * 20;

List<MqttServer> servers = new ArrayList<>();
Set<MqttServer> connectedServers = new ConcurrentHashSet<>();
Set<MqttServer> connectedServers = ConcurrentHashMap.newKeySet();

CountDownLatch latchListen = new CountDownLatch(numServers);
CountDownLatch latchConns = new CountDownLatch(numConnections);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.vertx.core.MultiMap;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.impl.ConcurrentHashSet;
import io.vertx.core.impl.logging.Logger;
import io.vertx.core.impl.logging.LoggerFactory;
import io.vertx.ext.unit.Async;
Expand Down Expand Up @@ -75,7 +74,7 @@ public void sharedServersRoundRobin(TestContext context) {
int numConnections = numServers * 20;

List<MqttServer> servers = new ArrayList<>();
Set<MqttServer> connectedServers = new ConcurrentHashSet<>();
Set<MqttServer> connectedServers = ConcurrentHashMap.newKeySet();

CountDownLatch latchListen = new CountDownLatch(numServers);
CountDownLatch latchConns = new CountDownLatch(numConnections);
Expand Down

0 comments on commit 0fb6d39

Please sign in to comment.