Skip to content

Commit 46f4078

Browse files
committed
Fix incorrect key in concurrent benchmarks
Fixes #111
1 parent 8026b57 commit 46f4078

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ func benchmarkCacheGetManyConcurrent(b *testing.B, exp time.Duration) {
15551555
tc := New(exp, 0)
15561556
keys := make([]string, n)
15571557
for i := 0; i < n; i++ {
1558-
k := "foo" + strconv.Itoa(n)
1558+
k := "foo" + strconv.Itoa(i)
15591559
keys[i] = k
15601560
tc.Set(k, "bar", DefaultExpiration)
15611561
}

sharded_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func benchmarkShardedCacheGetManyConcurrent(b *testing.B, exp time.Duration) {
6565
tsc := unexportedNewSharded(exp, 0, 20)
6666
keys := make([]string, n)
6767
for i := 0; i < n; i++ {
68-
k := "foo" + strconv.Itoa(n)
68+
k := "foo" + strconv.Itoa(i)
6969
keys[i] = k
7070
tsc.Set(k, "bar", DefaultExpiration)
7171
}

0 commit comments

Comments
 (0)