]> Cypherpunks repositories - gostls13.git/commitdiff
bytes: fix description of FieldsFunc
authorShenghou Ma <minux.ma@gmail.com>
Fri, 13 Dec 2013 03:13:19 +0000 (22:13 -0500)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 13 Dec 2013 03:13:19 +0000 (22:13 -0500)
Similar to CL 3814041 that fixed the same issue in strings.
Fixes #6941.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41490045

src/pkg/bytes/bytes.go

index 01a5d9ae4ecaa7d5622efd2c4c8ff36beaf8807b..644bf75b894336ea9f7dae7c60ecd73e840d15e4 100644 (file)
@@ -265,8 +265,8 @@ func Fields(s []byte) [][]byte {
 
 // FieldsFunc interprets s as a sequence of UTF-8-encoded Unicode code points.
 // It splits the slice s at each run of code points c satisfying f(c) and
-// returns a slice of subslices of s.  If no code points in s satisfy f(c), an
-// empty slice is returned.
+// returns a slice of subslices of s.  If all code points in s satisfy f(c), or
+// len(s) == 0, an empty slice is returned.
 func FieldsFunc(s []byte, f func(rune) bool) [][]byte {
        n := 0
        inField := false