mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
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.
This commit is contained in:
parent
0e508876d2
commit
ab5aec6c30
@ -92,10 +92,6 @@ abstract class Event{
|
|||||||
$currentList = $handlerList;
|
$currentList = $handlerList;
|
||||||
while($currentList !== null){
|
while($currentList !== null){
|
||||||
foreach($currentList->getListenersByPriority($priority) as $registration){
|
foreach($currentList->getListenersByPriority($priority) as $registration){
|
||||||
if(!$registration->getPlugin()->isEnabled()){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$registration->callEvent($this);
|
$registration->callEvent($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user