Skip to content

Commit

Permalink
fix appendDecodeBase62 benchmark so it doesn't cause a memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Achille Roussel committed Jun 14, 2017
1 parent 50312ba commit ca614be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base62_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ func BenchmarkAppendDecodeBase62(b *testing.B) {
id := []byte(New().String())

for i := 0; i != b.N; i++ {
appendDecodeBase62(a[:0], id)
b := [stringEncodedLength]byte{}
copy(b[:], id)
appendDecodeBase62(a[:0], b[:])
}
}

Expand Down

0 comments on commit ca614be

Please sign in to comment.