Skip to content

Commit

Permalink
perf:remove unnecessary code for ZookeeperRegistry#doSubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCqupt committed Oct 16, 2023
1 parent 1f84cdc commit ca2b1a7
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ public void doSubscribe(final URL url, final NotifyListener listener) {
for (String path : toCategoriesPath(url)) {
ConcurrentMap<NotifyListener, ChildListener> listeners = zkListeners.computeIfAbsent(url, k -> new ConcurrentHashMap<>());
ChildListener zkListener = listeners.computeIfAbsent(listener, k -> new RegistryChildListenerImpl(url, k, latch));
if (zkListener instanceof RegistryChildListenerImpl) {
((RegistryChildListenerImpl) zkListener).setLatch(latch);
}

zkClient.create(path, false);
List<String> children = zkClient.addChildListener(path, zkListener);
if (children != null) {
Expand Down

0 comments on commit ca2b1a7

Please sign in to comment.