Skip to content

Commit

Permalink
Converting from string() to strconv.Itoa
Browse files Browse the repository at this point in the history
  • Loading branch information
Acho Arnold committed Aug 16, 2020
1 parent bfe0f8a commit 237896f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cache_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package lfucache

import (
"strconv"
"testing"

"github.com/dgrijalva/lfu-go"
Expand Down Expand Up @@ -389,12 +390,12 @@ func BenchmarkCache(b *testing.B) {

for i := 0; i < b.N; i++ {
for j := 0; j < 1000; j++ {
err = cache.Set(string(i), j)
err = cache.Set(strconv.Itoa(i), j)
if err != nil {
b.Fatal(err.Error())
}

_, err = cache.Get(string(i))
_, err = cache.Get(strconv.Itoa(i))
if err != nil {
b.Fatal(err.Error())
}
Expand All @@ -409,8 +410,8 @@ func BenchmarkOther(b *testing.B) {
if j >= 100 {
cache.Evict(1)
}
cache.Set(string(i), j)
cache.Get(string(i))
cache.Set(strconv.Itoa(i), j)
cache.Get(strconv.Itoa(i))
}
}
}

0 comments on commit 237896f

Please sign in to comment.