]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove no-op slice operation in Caller
authorDmitri Shuralyov <dmitshur@golang.org>
Mon, 15 Apr 2024 23:54:01 +0000 (19:54 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 16 Apr 2024 14:45:14 +0000 (14:45 +0000)
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 <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/runtime/extern.go

index 9a02e3682930570ebfd1662589effae204eb5881..bb2f03b1cee3eaf88f8c49d77012dfbded036f2e 100644 (file)
@@ -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
        }