From: hopehook Date: Thu, 7 Apr 2022 15:53:12 +0000 (+0800) Subject: strings, bytes: improve the description of simple case-folding in EqualFold X-Git-Tag: go1.19beta1~735 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c451a02a6d3e95d279260bd8c1edae676d62997d;p=gostls13.git strings, bytes: improve the description of simple case-folding in EqualFold This CL removes the problem description pointed out by @bjkail. Second, synchronously modify the comments of the bytes package. Updates #52022 Fixes #52204 Change-Id: I0aa52c774f40bb91f32bebdd2a62a11067a77be0 Reviewed-on: https://go-review.googlesource.com/c/go/+/398736 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Trust: Cherry Mui --- diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go index d9d502927e..979cf1ccf0 100644 --- a/src/bytes/bytes.go +++ b/src/bytes/bytes.go @@ -1142,7 +1142,7 @@ func ReplaceAll(s, old, new []byte) []byte { } // EqualFold reports whether s and t, interpreted as UTF-8 strings, -// are equal under Unicode case-folding, which is a more general +// are equal under simple Unicode case-folding, which is a more general // form of case-insensitivity. func EqualFold(s, t []byte) bool { for len(s) != 0 && len(t) != 0 { diff --git a/src/strings/strings.go b/src/strings/strings.go index 74e505338e..8294f7ec35 100644 --- a/src/strings/strings.go +++ b/src/strings/strings.go @@ -1043,8 +1043,6 @@ func ReplaceAll(s, old, new string) string { // EqualFold reports whether s and t, interpreted as UTF-8 strings, // are equal under simple Unicode case-folding, which is a more general // form of case-insensitivity. -// -// EqualFold(s, t) is equivalent to Tolower(s) == Tolower(t). func EqualFold(s, t string) bool { for s != "" && t != "" { // Extract first rune from each string.