Commit 5188b4de authored by Joe Kyo's avatar Joe Kyo Committed by Ian Lance Taylor

encoding/binary: returns length of bool slice in intDataSize

intDataSize should return length of bool slice, so functions
Read and Write can use the fast path to process bool slice.

Change-Id: I8cd275e3ffea82024850662d86caca64bd91bf70
Reviewed-on: https://go-review.googlesource.com/112135Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
parent 6428c892
...@@ -665,6 +665,8 @@ func intDataSize(data interface{}) int { ...@@ -665,6 +665,8 @@ func intDataSize(data interface{}) int {
switch data := data.(type) { switch data := data.(type) {
case bool, int8, uint8, *bool, *int8, *uint8: case bool, int8, uint8, *bool, *int8, *uint8:
return 1 return 1
case []bool:
return len(data)
case []int8: case []int8:
return len(data) return len(data)
case []uint8: case []uint8:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment