Skip to content

Commit

Permalink
strings: remove "a copy of the string" from ToUpper/ToLower comments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
maksadbek authored and bradfitz committed Apr 14, 2019
1 parent a6e892d commit a01d108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/strings/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down Expand Up @@ -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++ {
Expand Down

0 comments on commit a01d108

Please sign in to comment.