]> Cypherpunks.ru repositories - gostls13.git/commit
errors: optimize *joinError's Error method for less allocation and faster execution
authorJes Cok <xigua67damn@gmail.com>
Tue, 6 Jun 2023 23:25:42 +0000 (23:25 +0000)
committerDamien Neil <dneil@google.com>
Mon, 31 Jul 2023 18:37:32 +0000 (18:37 +0000)
commit26fc4aa956783268d7a289240a028774e1ea3878
treee49996219c9432400cd5642ebd3b8885a8f5b836
parent17d67ed0c904871bb2738ec7d1ed7831924c9aaf
errors: optimize *joinError's Error method for less allocation and faster execution

Handle the case of one error at the beginning.
Use unsafe.String to avoid memory allocation when converting byte slice to string.

Change-Id: Ib23576f72b1d87489e6f17762be483f62ca4998a
GitHub-Last-Rev: ed8003bfbcae8efd42e54895db0554c139b9d3a7
GitHub-Pull-Request: golang/go#60026
Reviewed-on: https://go-review.googlesource.com/c/go/+/493237
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
src/errors/join.go