diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-17 12:35:35 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-17 12:35:35 +0000 |
commit | 2aad3ce052623742a27825960df803200c4fa5d7 (patch) | |
tree | d7f9f1926372e5ce033911ea4d36bbef2e361aaf /includes | |
parent | 7864b0066b4ad3fc17ce1526b1e4ecae52b2f9c8 (diff) | |
download | brdo-2aad3ce052623742a27825960df803200c4fa5d7.tar.gz brdo-2aad3ce052623742a27825960df803200c4fa5d7.tar.bz2 |
- Patch #768518 by catch: element_info() should use drupal_static_fast() pattern.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc index b3497d0d9..312246d77 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5291,7 +5291,12 @@ function element_sort($a, $b) { * Retrieve the default properties for the defined element type. */ function element_info($type) { - $cache = &drupal_static(__FUNCTION__); + // Use the advanced drupal_static() pattern, since this is called very often. + static $drupal_static_fast; + if (!isset($drupal_static_fast)) { + $drupal_static_fast['cache'] = &drupal_static(__FUNCTION__); + } + $cache = &$drupal_static_fast['cache']; if (!isset($cache)) { $cache = module_invoke_all('element_info'); |