Skip to content

Commit 298fb20

Browse files
author
Alex Peck
committed
comment
1 parent b4ff633 commit 298fb20

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

BitFaster.Caching/Lfu/ConcurrentLfu.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ public bool TryRemove(KeyValuePair<K, V> item)
334334
#if NET6_0_OR_GREATER
335335
if (this.dictionary.TryRemove(kvp))
336336
#else
337+
// https://devblogs.microsoft.com/pfxteam/little-known-gems-atomic-conditional-removals-from-concurrentdictionary/
337338
if (((ICollection<KeyValuePair<K, LfuNode<K, V>>>)this.dictionary).Remove(kvp))
338339
#endif
339340
{

BitFaster.Caching/Lru/ClassicLru.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ public bool TryRemove(KeyValuePair<K, V> item)
253253
#if NET6_0_OR_GREATER
254254
if (this.dictionary.TryRemove(kvp))
255255
#else
256+
// https://devblogs.microsoft.com/pfxteam/little-known-gems-atomic-conditional-removals-from-concurrentdictionary/
256257
if (((ICollection<KeyValuePair<K, LinkedListNode<LruItem>>>)this.dictionary).Remove(kvp))
257258
#endif
258259
{

BitFaster.Caching/Lru/ConcurrentLruCore.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ public bool TryRemove(KeyValuePair<K, V> item)
308308
#if NET6_0_OR_GREATER
309309
if (this.dictionary.TryRemove(kvp))
310310
#else
311+
// https://devblogs.microsoft.com/pfxteam/little-known-gems-atomic-conditional-removals-from-concurrentdictionary/
311312
if (((ICollection<KeyValuePair<K, I>>)this.dictionary).Remove(kvp))
312313
#endif
313314
{

0 commit comments

Comments
 (0)