mirror of
https://github.com/patrickmn/go-cache.git
synced 2025-10-04 23:32:39 +08:00
Add an interface, embed the mutex, and unexport some unnecessarily exported fields
This commit is contained in:
@@ -807,10 +807,10 @@ func BenchmarkCacheSetDeleteSingleLock(b *testing.B) {
|
||||
tc := New(0, 0)
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
tc.mu.Lock()
|
||||
tc.Lock()
|
||||
tc.set("foo", "bar", 0)
|
||||
tc.delete("foo")
|
||||
tc.mu.Unlock()
|
||||
tc.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user