]> git.mjollnir.org Git - s9y.git/commitdiff
Some more minor performance tuning
authorgarvinhicking <garvinhicking>
Sat, 29 Apr 2006 13:06:11 +0000 (13:06 +0000)
committergarvinhicking <garvinhicking>
Sat, 29 Apr 2006 13:06:11 +0000 (13:06 +0000)
include/plugin_api.inc.php

index cdc761d415b828aea9d530bca50c4b803b1435d0..e0930ee666d61762884533a44acfb6df5b81ea3b 100644 (file)
@@ -974,17 +974,21 @@ class serendipity_plugin_api {
             return false;
         }
 
-        $plugins = serendipity_plugin_api::get_event_plugins();
+        $plugins =& serendipity_plugin_api::get_event_plugins();
 
         if (is_array($plugins)) {
             // foreach() operates on copies of values, but we want to operate on references, so we use while()
             @reset($plugins);
             while(list($plugin, $plugin_data) = each($plugins)) {
-                $bag = &$plugin_data['b'];
-                if (array_key_exists($event_name, $bag->get('event_hooks'))) {
+                $bag    = &$plugin_data['b'];
+                $phooks = &$bag->get('event_hooks');
+                if (isset($phooks[$event_name])) {
                     // Check for cachable events.
-                    if (isset($eventData['is_cached']) && $eventData['is_cached'] && array_key_exists($event_name, (array)$bag->get('cachable_events'))) {
-                        continue;
+                    if (isset($eventData['is_cached']) && $eventData['is_cached']) {
+                        $chooks = &$bag->get('cachable_events');
+                        if (is_array($chooks) && isset($chooks[$event_name])) {
+                            continue;
+                        }
                     }
 
                     $plugin_data['p']->event_hook($event_name, $bag, $eventData, $addData);