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
synchronized (lock) {
final int childCount = childEventMap.getInt(eventClass);
if (childCount < 1) {
if (childEventMap.isEmpty() || childEventMap.getInt(eventClass) < 1) {
// No listener in children
return;
}