Commit fcbae457 authored by Steven Wittens's avatar Steven Wittens
Browse files

#108310: Minor speed up, cache theme functions in theme_get_function().

parent 74c7e1dc
...@@ -159,11 +159,15 @@ function list_theme_engines($refresh = FALSE) { ...@@ -159,11 +159,15 @@ function list_theme_engines($refresh = FALSE) {
* An HTML string that generates the themed output. * An HTML string that generates the themed output.
*/ */
function theme() { function theme() {
static $functions;
$args = func_get_args(); $args = func_get_args();
$function = array_shift($args); $function = array_shift($args);
if ($func = theme_get_function($function)) { if (!isset($functions[$function])) {
return call_user_func_array($func, $args); $functions[$function] = theme_get_function($function);
}
if ($functions[$function]) {
return call_user_func_array($functions[$function], $args);
} }
} }
......
Supports Markdown
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