unicode/utf8: removed uses of ranging over string
unicode/utf8: removed uses of ranging over string

Ranging over string is much slower than using DecodeRuneInString.
See golang.org/issue/13162.

Replacing ranging over a string with the implementation of the Bytes
counterpart results in the following performance improvements:

RuneCountInStringTenASCIIChars-8     43.0ns ± 1%  16.4ns ± 2%  -61.80%  (p=0.000 n=7+8)
RuneCountInStringTenJapaneseChars-8   161ns ± 2%   154ns ± 2%   -4.58%  (p=0.000 n=8+8)
ValidStringTenASCIIChars-8           52.2ns ± 1%  13.2ns ± 1%  -74.62%  (p=0.001 n=7+7)
ValidStringTenJapaneseChars-8         173ns ± 2%   153ns ± 2%  -11.78%  (p=0.000 n=7+8)

Update golang/go#13162

Change-Id: Ifc40a6a94bb3317f1f2d929d310bd2694645e9f6
Reviewed-on: https://go-review.googlesource.com/16695
Reviewed-by: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

cyberroadie/go,4ad/go,suncycheng/go,Jordanzuo/go,vanloswang/go,kim-racktop/go,roth1002/go,odeke-em/go,odeke-em/go,Samurais/go,codestation/go,deft-code/go,sndnvaps/go,binarycrusader/go,kim-racktop/go,mwhudson/go,goodlang/good,suncycheng/go,roth1002/go,golang/go,CAFxX/go,ganboing/go-esx,derekmarcotte/go,Endika/go,goodlang/good,linux-on-ibm-z/go,binarycrusader/go,deft-code/go,akutz/go,polyverse-security/go,mwhudson/go,vsekhar/elastic-go,fjballest/golang,polyverse-security/go,ganboing/go-esx,momchil-velikov/go,codestation/go,sndnvaps/go,ganboing/go-esx,binarycrusader/go,josharian/go,sndnvaps/go,nawawi/go,odeke-em/go,cloudflare/go,Jordanzuo/go,josharian/go,odeke-em/go,momchil-velikov/go,nawawi/go,cloudflare/go,Cofyc/go,polyverse-security/go,polyverse-security/go,nawawi/go,miolini/go,theif519/go,golang/go,mwhudson/go,linux-on-ibm-z/go,roth1002/go,golang/go,ImJasonH/go,odeke-em/go,theif519/go,CAFxX/go,josharian/go,polyverse-security/go,cyberroadie/go,josharian/go,ImJasonH/go,Samurais/go,vanloswang/go,vsekhar/elastic-go,ganboing/go-esx,theif519/go,fjballest/golang,goodlang/good,fjballest/golang,golang/go,cloudflare/go,4ad/go,Endika/go,codestation/go,CAFxX/go,binarycrusader/go,binarycrusader/go,akutz/go,4ad/go,mwhudson/go,Samurais/go,suncycheng/go,vsekhar/elastic-go,mwhudson/go,miolini/go,suncycheng/go,Jordanzuo/go,cloudflare/go,goodlang/good,akutz/go,4ad/go,linux-on-ibm-z/go,roth1002/go,cyberroadie/go,suncycheng/go,sndnvaps/go,goodlang/good,theif519/go,kim-racktop/go,golang/go,momchil-velikov/go,roth1002/go,Cofyc/go,sndnvaps/go,nawawi/go,goodlang/good,vsekhar/elastic-go,cyberroadie/go,akutz/go,derekmarcotte/go,cyberroadie/go,Jordanzuo/go,deft-code/go,suncycheng/go,vanloswang/go,miolini/go,josharian/go,Endika/go,derekmarcotte/go,miolini/go,akutz/go,Endika/go,cloudflare/go,momchil-velikov/go,Jordanzuo/go,roth1002/go,derekmarcotte/go,golang/go,momchil-velikov/go,nawawi/go,kim-racktop/go,codestation/go,Cofyc/go,Jordanzuo/go,binarycrusader/go,ImJasonH/go,ImJasonH/go,binarycrusader/go,vanloswang/go,Samurais/go,linux-on-ibm-z/go,codestation/go,Jordanzuo/go,vanloswang/go,deft-code/go,linux-on-ibm-z/go,ImJasonH/go,vanloswang/go,akutz/go,mwhudson/go,vsekhar/elastic-go,Cofyc/go,Endika/go,goodlang/good,fjballest/golang,sndnvaps/go,theif519/go,derekmarcotte/go,odeke-em/go,nawawi/go,4ad/go,linux-on-ibm-z/go,linux-on-ibm-z/go,binarycrusader/go,polyverse-security/go,ImJasonH/go,CAFxX/go,nawawi/go,miolini/go,miolini/go,CAFxX/go,linux-on-ibm-z/go,ganboing/go-esx,theif519/go,roth1002/go,theif519/go,Cofyc/go,kim-racktop/go,momchil-velikov/go,momchil-velikov/go,fjballest/golang,mwhudson/go,ImJasonH/go,vsekhar/elastic-go,CAFxX/go,derekmarcotte/go,ganboing/go-esx,4ad/go,codestation/go,momchil-velikov/go,Jordanzuo/go,polyverse-security/go,ganboing/go-esx,suncycheng/go,akutz/go,derekmarcotte/go,derekmarcotte/go,Cofyc/go,vanloswang/go,ImJasonH/go,josharian/go,mwhudson/go,vsekhar/elastic-go,Samurais/go,golang/go,Cofyc/go,codestation/go,odeke-em/go,deft-code/go,odeke-em/go,cyberroadie/go,theif519/go,deft-code/go,4ad/go,4ad/go,Endika/go,CAFxX/go,cloudflare/go,christopher-henderson/Go,deft-code/go,cloudflare/go,suncycheng/go,kim-racktop/go,goodlang/good,cyberroadie/go,akutz/go,ganboing/go-esx,golang/go,vanloswang/go,josharian/go,fjballest/golang,vsekhar/elastic-go,Endika/go,roth1002/go,sndnvaps/go,josharian/go,sndnvaps/go,kim-racktop/go,deft-code/go,Samurais/go,cyberroadie/go,Cofyc/go,cloudflare/go,kim-racktop/go,polyverse-security/go,miolini/go,fjballest/golang,CAFxX/go,Samurais/go,fjballest/golang,Samurais/go,nawawi/go,miolini/go,Endika/go,codestation/go