summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-01-02 17:39:19 +0000
committerDries Buytaert <dries@buytaert.net>2010-01-02 17:39:19 +0000
commit8f6e5a46790fad34271aa8baeca4750af4022160 (patch)
treeabdeea3f3c1cee60c7cef97b4e79c3759b172697 /includes
parentb12d812b9397609a5853d8c2b73f29d282496fd9 (diff)
downloadbrdo-8f6e5a46790fad34271aa8baeca4750af4022160.tar.gz
brdo-8f6e5a46790fad34271aa8baeca4750af4022160.tar.bz2
- Patch #634310 by casey: small improvement of drupal_render(): conditionally call element_children().
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc6
1 files changed, 2 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 9c4ce49f8..85c115af8 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5026,9 +5026,6 @@ function drupal_render(&$elements) {
return;
}
- // Get the children of the element, sorted by weight.
- $children = element_children($elements, TRUE);
-
// Initialize this element's #children, unless a #pre_render callback already
// preset #children.
if (!isset($elements['#children'])) {
@@ -5043,7 +5040,8 @@ function drupal_render(&$elements) {
// This is the same process as drupal_render_children() but is inlined
// for speed.
if ($elements['#children'] == '') {
- foreach ($children as $key) {
+ // Iterate through the children of the element, sorted by weight.
+ foreach (element_children($elements, TRUE) as $key) {
$elements['#children'] .= drupal_render($elements[$key]);
}
}