Reuse call method for mapped nodes

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-08-27 09:55:10 +02:00
parent 5c9c57439a
commit 4680dbd64e
1 changed files with 1 additions and 6 deletions

View File

@ -339,12 +339,7 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
final BiConsumer<EventFilter<E, ?>, E> mapper = (filter, event) -> {
final Object handler = filter.castHandler(event);
final Handle<E> handle = handlers.get(handler);
if (handle != null) { // Run the listeners of the mapped node
handle.update();
for (Consumer<E> listener : handle.listeners) {
listener.accept(event);
}
}
if (handle != null) handle.call(event);
};
if (filterList.length == 1) {
final var firstFilter = filterList[0];