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

5.x
Steven Wittens 2007-01-11 03:36:06 +00:00
parent 74c7e1dce8
commit fcbae4572c
1 changed files with 6 additions and 2 deletions

View File

@ -159,11 +159,15 @@ function list_theme_engines($refresh = FALSE) {
* An HTML string that generates the themed output.
*/
function theme() {
static $functions;
$args = func_get_args();
$function = array_shift($args);
if ($func = theme_get_function($function)) {
return call_user_func_array($func, $args);
if (!isset($functions[$function])) {
$functions[$function] = theme_get_function($function);
}
if ($functions[$function]) {
return call_user_func_array($functions[$function], $args);
}
}