diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-01-10 23:30:07 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-01-10 23:30:07 +0000 |
commit | eb28074aa33f4768f84fe75ae2c3826f2dbe55af (patch) | |
tree | c63e91d1b8c4a257a34ccd878cea0277487ac93f /includes/common.inc | |
parent | 193f359cd44573ac3ae84d8bab9b93c826e73ea1 (diff) | |
download | brdo-eb28074aa33f4768f84fe75ae2c3826f2dbe55af.tar.gz brdo-eb28074aa33f4768f84fe75ae2c3826f2dbe55af.tar.bz2 |
#108320: Form API optimization, don't call element_sort unless needed.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc index b55384e2a..acd66a789 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2113,7 +2113,11 @@ function drupal_render(&$elements) { } $content = ''; - uasort($elements, "_element_sort"); + // Either the elements did not go through form_builder or one of the children + // has a #weight. + if (!isset($elements['#sorted'])) { + uasort($elements, "_element_sort"); + } if (!isset($elements['#children'])) { $children = element_children($elements); /* Render all the children that use a theme function */ |