]> Cypherpunks.ru repositories - netstring.git/blobdiff - r.go
Optimize indexing
[netstring.git] / r.go
diff --git a/r.go b/r.go
index ca1925908d09e22a1c6b33fe487da9880c06216b..0637ec692af823aeaba9abf7ffe462a041b00677 100644 (file)
--- 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")
        }