Skip to content

Commit

Permalink
Fix incorrect key in concurrent benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmn committed Oct 4, 2019
1 parent 8026b57 commit 46f4078
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ func benchmarkCacheGetManyConcurrent(b *testing.B, exp time.Duration) {
tc := New(exp, 0)
keys := make([]string, n)
for i := 0; i < n; i++ {
k := "foo" + strconv.Itoa(n)
k := "foo" + strconv.Itoa(i)
keys[i] = k
tc.Set(k, "bar", DefaultExpiration)
}
Expand Down
2 changes: 1 addition & 1 deletion sharded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func benchmarkShardedCacheGetManyConcurrent(b *testing.B, exp time.Duration) {
tsc := unexportedNewSharded(exp, 0, 20)
keys := make([]string, n)
for i := 0; i < n; i++ {
k := "foo" + strconv.Itoa(n)
k := "foo" + strconv.Itoa(i)
keys[i] = k
tsc.Set(k, "bar", DefaultExpiration)
}
Expand Down

0 comments on commit 46f4078

Please sign in to comment.