diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-01-11 03:36:06 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-01-11 03:36:06 +0000 |
commit | fcbae4572c12d599c65301b7f174d92f24801746 (patch) | |
tree | 59869966a8fc1f678dfbb8d60d436bc00781a0d0 | |
parent | 74c7e1dce8b28ef3ed050cba9df62ab268242743 (diff) | |
download | brdo-fcbae4572c12d599c65301b7f174d92f24801746.tar.gz brdo-fcbae4572c12d599c65301b7f174d92f24801746.tar.bz2 |
#108310: Minor speed up, cache theme functions in theme_get_function().
-rw-r--r-- | includes/theme.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 4a3acecb9..a5aab93ea 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -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); } } |