remove unused bytesSplit function

This commit is contained in:
Marten Seemann 2021-03-30 15:53:29 +07:00
parent d7d65e5590
commit e2f4e4e83c

View File

@ -176,29 +176,3 @@ func sizeForAddr(p Protocol, b []byte) (skip, size int, err error) {
return n, size, nil
}
}
func bytesSplit(b []byte) ([][]byte, error) {
var ret [][]byte
for len(b) > 0 {
code, n, err := ReadVarintCode(b)
if err != nil {
return nil, err
}
p := ProtocolWithCode(code)
if p.Code == 0 {
return nil, fmt.Errorf("no protocol with code %d", b[0])
}
n2, size, err := sizeForAddr(p, b[n:])
if err != nil {
return nil, err
}
length := n + n2 + size
ret = append(ret, b[:length])
b = b[length:]
}
return ret, nil
}