]> Cypherpunks repositories - gostls13.git/commitdiff
strings: remove "a copy of the string" from ToUpper/ToLower comments
authorМаксадбек Ахмедов <a.maksadbek@gmail.com>
Sat, 13 Apr 2019 14:38:36 +0000 (17:38 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 14 Apr 2019 16:19:31 +0000 (16:19 +0000)
When string letters are all in lower/upper cases, both functions respectively
return original string.

Fixes #30987

Change-Id: Ie8d664f7af5e087f82c1bc156933e9a995645bf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/171735
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/strings/strings.go

index 1805a14bd2b1cc13de4f14c5e67fc97771cee223..e3fdd9feaffd86de08fdc9db433aef52abf909a2 100644 (file)
@@ -550,7 +550,7 @@ func Repeat(s string, count int) string {
        return b.String()
 }
 
-// ToUpper returns a copy of the string s with all Unicode letters mapped to their upper case.
+// ToUpper returns s with all Unicode letters mapped to their upper case.
 func ToUpper(s string) string {
        isASCII, hasLower := true, false
        for i := 0; i < len(s); i++ {
@@ -580,7 +580,7 @@ func ToUpper(s string) string {
        return Map(unicode.ToUpper, s)
 }
 
-// ToLower returns a copy of the string s with all Unicode letters mapped to their lower case.
+// ToLower returns s with all Unicode letters mapped to their lower case.
 func ToLower(s string) string {
        isASCII, hasUpper := true, false
        for i := 0; i < len(s); i++ {