From: Dmitri Shuralyov Date: Mon, 15 Apr 2024 23:54:01 +0000 (-0400) Subject: runtime: remove no-op slice operation in Caller X-Git-Tag: go1.23rc1~612 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f17b28de78e7b2debd555f84a0e48be010e4fc88;p=gostls13.git runtime: remove no-op slice operation in Caller rpc was an array prior to CL 152537, so it was necessary to slice it since callers accepts a slice. Now that rpc is already a slice, slicing it is no longer required. Change-Id: Ie646ef5e494323c9fb58f3a24f942e3b1ff639ea Reviewed-on: https://go-review.googlesource.com/c/go/+/579016 Reviewed-by: Keith Randall Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov --- diff --git a/src/runtime/extern.go b/src/runtime/extern.go index 9a02e36829..bb2f03b1ce 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -297,7 +297,7 @@ import ( // call. The boolean ok is false if it was not possible to recover the information. func Caller(skip int) (pc uintptr, file string, line int, ok bool) { rpc := make([]uintptr, 1) - n := callers(skip+1, rpc[:]) + n := callers(skip+1, rpc) if n < 1 { return }