From: Sergey Matveev Date: Mon, 19 Jul 2021 11:17:36 +0000 (+0300) Subject: Optimize indexing X-Git-Tag: v2.2.0^0 X-Git-Url: http://www.git.cypherpunks.ru/?p=netstring.git;a=commitdiff_plain;h=fff06d86fd4a1302ca2e71acd1b79fd9d7bb56bb Optimize indexing --- diff --git a/r.go b/r.go index ca19259..0637ec6 100644 --- a/r.go +++ b/r.go @@ -48,7 +48,7 @@ func (r *Reader) Next() (uint64, error) { if len(p) == 0 { return 0, io.EOF } - idx := bytes.Index(p, []byte{':'}) + idx := bytes.IndexByte(p, ':') if idx == -1 { return 0, errors.New("no length separator found") }