Commit 086d1890 authored by Dries's avatar Dries
Browse files

- Patch #572452 by catch, JoshuaRogers: drupal_get_filename() and...

- Patch #572452 by catch, JoshuaRogers: drupal_get_filename() and drupal_load() should not use drupal_static(). Performance improvement.
parent fc6656b3
......@@ -631,7 +631,9 @@ function drupal_settings_initialize() {
* The filename of the requested item.
*/
function drupal_get_filename($type, $name, $filename = NULL) {
$files = &drupal_static(__FUNCTION__, array());
// The location of files will not change during the request, so do not use
// drupal_static().
static $files = array();
if (!isset($files[$type])) {
$files[$type] = array();
......@@ -834,7 +836,9 @@ function bootstrap_invoke_all($hook) {
* TRUE if the item is loaded or has already been loaded.
*/
function drupal_load($type, $name) {
$files = &drupal_static(__FUNCTION__, array());
// Once a file is included this can't be reversed during a request so do not
// use drupal_static() here.
static $files = array();
if (isset($files[$type][$name])) {
return TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment