go/src/strings
Keith Randall 56b7c61c5e strings: declare IndexByte as noescape
This lets []byte->string conversions which are used as arguments to
strings.IndexByte and friends have their backing store allocated on
the stack.

It only prevents allocation when the string is small enough (32
bytes), so it isn't perfect. But reusing the []byte backing store
directly requires a bunch more compiler analysis (see #2205 and
related issues).

Fixes #25864.

Change-Id: Ie52430422196e3c91e5529d6e56a8435ced1fc4c
Reviewed-on: https://go-review.googlesource.com/c/146018
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-30 20:03:54 +00:00
..
builder.go strings: add Builder.Cap 2018-08-20 13:04:52 +00:00
builder_test.go strings: add Builder.Cap 2018-08-20 13:04:52 +00:00
compare.go
compare_test.go strings: do much less redundant testing in TestCompareStrings 2018-07-02 14:39:29 +00:00
example_test.go all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
export_test.go strings: select Replacer algorithm and build machine lazily 2018-08-21 02:50:58 +00:00
reader.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
reader_test.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
replace.go strings: Replace s[:] to s where s is a slice. 2018-10-13 11:17:13 +00:00
replace_test.go
search.go all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
search_test.go all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
strings.go strings: correctly handle invalid utf8 sequences in Map 2018-10-03 21:27:10 +00:00
strings.s
strings_decl.go strings: declare IndexByte as noescape 2018-10-30 20:03:54 +00:00
strings_test.go strings: correctly handle invalid utf8 sequences in Map 2018-10-03 21:27:10 +00:00