Skip to content

Commit 4b2f3a0

Browse files
authored
nolock (#49)
1 parent 12779d0 commit 4b2f3a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

BitFaster.Caching/Lru/TemplateConcurrentLru.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ public TemplateConcurrentLru(
8484
this.hitCounter = hitCounter;
8585
}
8686

87-
public int Count => this.dictionary.Count;
87+
// No lock count: https://arbel.net/2013/02/03/best-practices-for-using-concurrentdictionary/
88+
public int Count => this.dictionary.Skip(0).Count();
8889

8990
public int HotCount => this.hotCount;
9091

0 commit comments

Comments
 (0)