From f39fc8c81ec6b10bb694c6e2a40a59414a8eb328 Mon Sep 17 00:00:00 2001 From: TheMode Date: Fri, 4 Jun 2021 04:14:41 +0200 Subject: [PATCH] Fast exit when a node as no child --- src/main/java/net/minestom/server/event/EventNode.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/event/EventNode.java b/src/main/java/net/minestom/server/event/EventNode.java index a86754049..82316d584 100644 --- a/src/main/java/net/minestom/server/event/EventNode.java +++ b/src/main/java/net/minestom/server/event/EventNode.java @@ -121,8 +121,7 @@ public class EventNode { } // Process children synchronized (lock) { - final int childCount = childEventMap.getInt(eventClass); - if (childCount < 1) { + if (childEventMap.isEmpty() || childEventMap.getInt(eventClass) < 1) { // No listener in children return; }