Removed slice appending for integers
This commit is contained in:
@ -15,7 +15,6 @@ func TestEncode(t *testing.T) {
|
||||
dec,_ := Decode(bytes, 0)
|
||||
fmt.Printf("raw: %v encoded: %q == %v\n", dec, str, "dog")
|
||||
|
||||
|
||||
sliceRes := "\x83CdogCgodCcat"
|
||||
strs := []string{"dog", "god", "cat"}
|
||||
bytes = Encode(strs)
|
||||
@ -27,3 +26,10 @@ func TestEncode(t *testing.T) {
|
||||
dec,_ = Decode(bytes, 0)
|
||||
fmt.Printf("raw: %v encoded: %q == %v\n", dec, slice, strs)
|
||||
}
|
||||
|
||||
func BenchmarkEncodeDecode(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
bytes := Encode([]string{"dog", "god", "cat"})
|
||||
Decode(bytes, 0)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user