]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: replace index and contains with bytealg calls
authorAustin Clements <austin@google.com>
Wed, 22 Jul 2020 15:21:36 +0000 (11:21 -0400)
committerAustin Clements <austin@google.com>
Mon, 17 Aug 2020 13:20:03 +0000 (13:20 +0000)
commit7bbd5ca5a6a94f58d33de6b1244248a32dc8cd9c
treeada66d10b1f53fd57340c5b75108582e42810458
parentdc12d5b0f5e9c1cfec2a8eb6dd7ff3473c36d45c
runtime: replace index and contains with bytealg calls

The runtime has its own implementation of string indexing. To reduce
code duplication and cognitive load, replace this with calls to the
internal/bytealg package. We can't do this on Plan 9 because it needs
string indexing in a note handler (which isn't allowed to use the
optimized bytealg version because it uses SSE), so we can't just
eliminate the index function, but this CL does down-scope it so make
it clear it's only for note handlers on Plan 9.

Change-Id: Ie1a142678262048515c481e8c26313b80c5875df
Reviewed-on: https://go-review.googlesource.com/c/go/+/244537
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/os_plan9.go
src/runtime/proc.go
src/runtime/runtime1.go
src/runtime/string.go
src/runtime/traceback.go