Fast exit when a node as no child

This commit is contained in:
TheMode 2021-06-04 04:14:41 +02:00
parent c4d521cde5
commit f39fc8c81e

View File

@ -121,8 +121,7 @@ public class EventNode<T extends Event> {
} }
// Process children // Process children
synchronized (lock) { synchronized (lock) {
final int childCount = childEventMap.getInt(eventClass); if (childEventMap.isEmpty() || childEventMap.getInt(eventClass) < 1) {
if (childCount < 1) {
// No listener in children // No listener in children
return; return;
} }