Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
1e5444e1
Unverified
Commit
1e5444e1
authored
5 months ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Minor optimisation
parent
6514d9fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/Cache/MemoryCache/LruMemoryCache.php
+8
-6
8 additions, 6 deletions
core/lib/Drupal/Core/Cache/MemoryCache/LruMemoryCache.php
with
8 additions
and
6 deletions
core/lib/Drupal/Core/Cache/MemoryCache/LruMemoryCache.php
+
8
−
6
View file @
1e5444e1
...
...
@@ -88,12 +88,14 @@ public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []):
* {@inheritdoc}
*/
public
function
invalidate
(
$cid
):
void
{
parent
::
invalidate
(
$cid
);
// Move the item to the least recently used position if it's not already
// there. This cannot use array_unshift() because it would reindex an array
// with numeric cache IDs.
if
(
isset
(
$this
->
cache
[
$cid
])
&&
$cid
!==
array_key_first
(
$this
->
cache
))
{
$this
->
cache
=
[
$cid
=>
$this
->
cache
[
$cid
]]
+
$this
->
cache
;
if
(
isset
(
$this
->
cache
[
$cid
]))
{
parent
::
invalidate
(
$cid
);
// Move the item to the least recently used position if it's not already
// there. This cannot use array_unshift() because it would reindex an array
// with numeric cache IDs.
if
(
$cid
!==
array_key_first
(
$this
->
cache
))
{
$this
->
cache
=
[
$cid
=>
$this
->
cache
[
$cid
]]
+
$this
->
cache
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment