From ab5aec6c302e8d5c10444294c0d774a6d87bc26b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 7 Oct 2018 16:36:30 +0100 Subject: [PATCH] Event: Remove unnecessary check from call() hot path This check is completely unnecessary since handlers get unregistered when a plugin is disabled. Additionally, this is an extremely hot path and this change produces a modest 5% performance improvement to event calls. --- src/pocketmine/event/Event.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pocketmine/event/Event.php b/src/pocketmine/event/Event.php index a481fa85f..965f18a51 100644 --- a/src/pocketmine/event/Event.php +++ b/src/pocketmine/event/Event.php @@ -92,10 +92,6 @@ abstract class Event{ $currentList = $handlerList; while($currentList !== null){ foreach($currentList->getListenersByPriority($priority) as $registration){ - if(!$registration->getPlugin()->isEnabled()){ - continue; - } - $registration->callEvent($this); }