[BUGFIX beta] indexOf eventlistener performance improvement

Fixes #3917