Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
2aad3ce0
Commit
2aad3ce0
authored
Apr 17, 2010
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#768518
by catch: element_info() should use drupal_static_fast() pattern.
parent
7864b006
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
includes/common.inc
includes/common.inc
+6
-1
No files found.
includes/common.inc
View file @
2aad3ce0
...
...
@@ -5291,7 +5291,12 @@ function element_sort($a, $b) {
* Retrieve the default properties for the defined element type.
*/
function
element_info
(
$type
)
{
$cache
=
&
drupal_static
(
__FUNCTION__
);
// Use the advanced drupal_static() pattern, since this is called very often.
static
$drupal_static_fast
;
if
(
!
isset
(
$drupal_static_fast
))
{
$drupal_static_fast
[
'cache'
]
=
&
drupal_static
(
__FUNCTION__
);
}
$cache
=
&
$drupal_static_fast
[
'cache'
];
if
(
!
isset
(
$cache
))
{
$cache
=
module_invoke_all
(
'element_info'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment