]> Cypherpunks.ru repositories - gostls13.git/commitdiff
strings, bytes: clarify usage of EqualFolds
authorAndrew Medvedev <andrew.y.medvedev@gmail.com>
Sat, 21 Sep 2019 12:47:34 +0000 (12:47 +0000)
committerRob Pike <r@golang.org>
Sat, 21 Sep 2019 21:45:58 +0000 (21:45 +0000)
This clarifies meaning of "case folding" Unicode equality with more familiar "case insensitive" wording.
For case folding properties see ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt.

Fixes #33447

Change-Id: I6ee85ab398679bf2a0b7d18693985ff0979d6c5a
GitHub-Last-Rev: accc9159330c61e046d77f77beac62b38bf72c19
GitHub-Pull-Request: golang/go#34434
Reviewed-on: https://go-review.googlesource.com/c/go/+/196717
Reviewed-by: Rob Pike <r@golang.org>
src/bytes/bytes.go
src/strings/strings.go

index eb13212384954a772dba3083612b3069e0fe60f4..e872cc20506b5dc32144b7f947766597c36f0b2e 100644 (file)
@@ -935,7 +935,8 @@ func ReplaceAll(s, old, new []byte) []byte {
 }
 
 // EqualFold reports whether s and t, interpreted as UTF-8 strings,
-// are equal under Unicode case-folding.
+// are equal under 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 {
                // Extract first rune from each.
index cee315ce9e4027b9647a0b1f550f91b3b92c277a..869cdcdcefb3d5c22875cf4b3fb82cab16583aa5 100644 (file)
@@ -969,7 +969,8 @@ func ReplaceAll(s, old, new string) string {
 }
 
 // EqualFold reports whether s and t, interpreted as UTF-8 strings,
-// are equal under Unicode case-folding.
+// are equal under Unicode case-folding, which is a more general
+// form of case-insensitivity.
 func EqualFold(s, t string) bool {
        for s != "" && t != "" {
                // Extract first rune from each string.