Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
aafd8aaf
Commit
aafd8aaf
authored
Jan 03, 2012
by
catch
Browse files
Issue
#1387766
by dereine: Added Use fast drupal static pattern for locale.
parent
7059b265
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/modules/locale/locale.module
View file @
aafd8aaf
...
...
@@ -634,7 +634,14 @@ function locale_language_delete($language) {
*/
function
locale
(
$string
=
NULL
,
$context
=
NULL
,
$langcode
=
NULL
)
{
global
$language
;
$locale_t
=
&
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
[
'locale'
]
=
&
drupal_static
(
__FUNCTION__
);
}
$locale_t
=
&
$drupal_static_fast
[
'locale'
];
if
(
!
isset
(
$string
))
{
// Return all cached strings if no string was specified
...
...
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