aboutsummaryrefslogtreecommitdiff
path: root/src/bytes
diff options
context:
space:
mode:
authorJohan Brandhorst <johan.brandhorst@gmail.com>2018-08-04 09:45:36 +0100
committerBrad Fitzpatrick <bradfitz@golang.org>2018-08-22 16:09:06 +0000
commit841a9136b3d737d1252f7c5c371f109f23d76b2d (patch)
treef1239a11b4bf400df7385ed78220830844eca419 /src/bytes
parent39eda0dac12a53f7f0c3189e5929d171e8e0b844 (diff)
downloadgo-841a9136b3d737d1252f7c5c371f109f23d76b2d.tar.gz
go-841a9136b3d737d1252f7c5c371f109f23d76b2d.zip
strings, bytes: avoid unnecessary function literals
A number of explicit function literals found through the unlambda linter are removed. Fixes #26802 Change-Id: I0b122bdd95e9cb804c77efe20483fdf681c8154e Reviewed-on: https://go-review.googlesource.com/127756 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Diffstat (limited to 'src/bytes')
-rw-r--r--src/bytes/bytes.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go
index 437a6e12df..77a7ce98e0 100644
--- a/src/bytes/bytes.go
+++ b/src/bytes/bytes.go
@@ -489,19 +489,19 @@ func ToTitle(s []byte) []byte { return Map(unicode.ToTitle, s) }
// ToUpperSpecial treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their
// upper case, giving priority to the special casing rules.
func ToUpperSpecial(c unicode.SpecialCase, s []byte) []byte {
- return Map(func(r rune) rune { return c.ToUpper(r) }, s)
+ return Map(c.ToUpper, s)
}
// ToLowerSpecial treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their
// lower case, giving priority to the special casing rules.
func ToLowerSpecial(c unicode.SpecialCase, s []byte) []byte {
- return Map(func(r rune) rune { return c.ToLower(r) }, s)
+ return Map(c.ToLower, s)
}
// ToTitleSpecial treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their
// title case, giving priority to the special casing rules.
func ToTitleSpecial(c unicode.SpecialCase, s []byte) []byte {
- return Map(func(r rune) rune { return c.ToTitle(r) }, s)
+ return Map(c.ToTitle, s)
}
// isSeparator reports whether the rune could mark a word boundary.