strings: delete Runes, Bytes

gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports

R=r
CC=golang-dev
https://golang.org/cl/224062
This commit is contained in:
Russ Cox 2010-02-25 16:01:29 -08:00
parent dfaa6eaa76
commit 9750adbbad
65 changed files with 239 additions and 310 deletions

View file

@ -302,23 +302,3 @@ func TrimSpace(s string) string {
}
return s[start:end]
}
// Bytes returns a new slice containing the bytes in s.
func Bytes(s string) []byte {
b := make([]byte, len(s))
for i := 0; i < len(s); i++ {
b[i] = s[i]
}
return b
}
// Runes returns a slice of runes (Unicode code points) equivalent to the string s.
func Runes(s string) []int {
t := make([]int, utf8.RuneCountInString(s))
i := 0
for _, r := range s {
t[i] = r
i++
}
return t
}