Skip to content

Commit 0bcfdea

Browse files
committed
Fix additional lookup on Remove
1 parent 257c32a commit 0bcfdea

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/SizeLimitedCache.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,9 @@ public void Remove(K key)
146146
{
147147
ArgumentNullException.ThrowIfNull(key, nameof(key));
148148

149-
if (!_nodeLookup.TryGetValue(key, out Node node))
149+
if (!_nodeLookup.Remove(key, out Node node))
150150
return;
151151

152-
_nodeLookup.Remove(key);
153-
154152
if (!node.IsPermanent)
155153
RemoveFromList(node);
156154
else

0 commit comments

Comments
 (0)