HHH-13477 Make heavily invoked method final: EventListenerGroupImpl#listeners()

This commit is contained in:
Sanne Grinovero 2019-06-24 22:06:20 +01:00
parent 663bbc81d7
commit 6ad8eaa896
1 changed files with 6 additions and 2 deletions

View File

@ -80,8 +80,12 @@ class EventListenerGroupImpl<T> implements EventListenerGroup<T> {
duplicationStrategies.add( strategy );
}
public Iterable<T> listeners() {
return listeners == null ? Collections.emptyList() : listeners;
/**
* Implementation note: should be final for performance reasons.
*/
@Override
public final Iterable<T> listeners() {
return listeners == null ? Collections.EMPTY_LIST : listeners;
}
@Override