use fmt.Sprint for string to int conversion

This commit is contained in:
Anton Kaliaev
2020-11-16 16:50:39 +04:00
parent a26551985f
commit 37010ad5b2
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -60,10 +60,10 @@ func TestContains(t *testing.T) {
func BenchmarkCMapHas(b *testing.B) {
m := NewCMap()
for i := 0; i < 1000; i++ {
m.Set(string(i), i)
m.Set(fmt.Sprint(i), i)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
m.Has(string(i))
m.Has(fmt.Sprint(i))
}
}
+1 -1
View File
@@ -382,7 +382,7 @@ func benchmarkNClients(n int, b *testing.B) {
s.PublishWithEvents(
ctx,
"Gamora",
map[string][]string{"abci.Account.Owner": {"Ivan"}, "abci.Invoices.Number": {string(i)}},
map[string][]string{"abci.Account.Owner": {"Ivan"}, "abci.Invoices.Number": {fmt.Sprint(i)}},
)
}
}