]> gcc.gnu.org Git - gcc.git/blobdiff - libgo/go/runtime/utf8.go
libgo: update to Go 1.11
[gcc.git] / libgo / go / runtime / utf8.go
index e8454516723a8ee4418991b236f39401d8ec0a15..0ba0dad835cd0d86ef3c5d0aaa242991bfe1f017 100644 (file)
@@ -46,6 +46,15 @@ const (
        hicb = 0xBF // 1011 1111
 )
 
+// countrunes returns the number of runes in s.
+func countrunes(s string) int {
+       n := 0
+       for range s {
+               n++
+       }
+       return n
+}
+
 // decoderune returns the non-ASCII rune at the start of
 // s[k:] and the index after the rune in s.
 //
This page took 0.025845 seconds and 5 git commands to generate.