mirror of
https://github.com/golang/go
synced 2024-11-12 09:20:22 -07:00
runtime: simplify slice expression to sliced value itself
Replace `x[:]` where x is a slice with just `x`. Found using https://go-critic.github.io/overview.html#unslice-ref Change-Id: Ib0ee16e1d49b2a875b6b92a770049acc33208362 Reviewed-on: https://go-review.googlesource.com/123375 Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
0a51940165
commit
fa6639d626
@ -584,10 +584,10 @@ func traceStackID(mp *m, buf []uintptr, skip int) uint64 {
|
||||
gp := mp.curg
|
||||
var nstk int
|
||||
if gp == _g_ {
|
||||
nstk = callers(skip+1, buf[:])
|
||||
nstk = callers(skip+1, buf)
|
||||
} else if gp != nil {
|
||||
gp = mp.curg
|
||||
nstk = gcallers(gp, skip, buf[:])
|
||||
nstk = gcallers(gp, skip, buf)
|
||||
}
|
||||
if nstk > 0 {
|
||||
nstk-- // skip runtime.goexit
|
||||
|
Loading…
Reference in New Issue
Block a user