(*buf).string previously manually searched
through its underlying byte slice until we
encountered a '0'. This change instead uses
bytes.IndexByte that results in a speed up:
$ benchstat before.txt after.txt
name old time/op new time/op delta
BufString-8 257ns ± 1% 174ns ± 1% -32.37% (p=0.000 n=9+8)
name old speed new speed delta
BufString-8 495MB/s ± 1% 732MB/s ± 1% +47.76% (p=0.000 n=10+8)
name old alloc/op new alloc/op delta
BufString-8 162B ± 0% 162B ± 0% ~ (all equal)
name old allocs/op new allocs/op delta
BufString-8 3.00 ± 0% 3.00 ± 0% ~ (all equal)