Skip to content

Commit

Permalink
Rename current handlers in handler map merge op
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed May 3, 2018
1 parent 042d3ff commit a712acd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/vertx/core/eventbus/impl/EventBusImpl.java
Expand Up @@ -266,17 +266,17 @@ private <T> LocalRegistrationResult<T> addLocalRegistration(String address, Hand
HandlerHolder<T> holder = new HandlerHolder<>(metrics, registration, replyHandler, localOnly, context);

CyclicSequence<HandlerHolder> handlers = new CyclicSequence<HandlerHolder>().add(holder);
CyclicSequence<HandlerHolder> newHandlers = handlerMap.merge(
CyclicSequence<HandlerHolder> actualHandlers = handlerMap.merge(
address,
handlers,
(oldHandlers, current) -> oldHandlers.add(current.first()));
(old, prev) -> old.add(prev.first()));

if (hasContext) {
HandlerEntry entry = new HandlerEntry<>(address, registration);
context.addCloseHook(entry);
}

boolean newAddress = handlers == newHandlers;
boolean newAddress = handlers == actualHandlers;
return new LocalRegistrationResult<>(holder, newAddress);
}

Expand Down

0 comments on commit a712acd

Please sign in to comment.