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:
Iskander Sharipov 2018-07-11 23:34:18 +03:00 committed by Brad Fitzpatrick
parent 0a51940165
commit fa6639d626
1 changed files with 2 additions and 2 deletions

View File

@ -584,10 +584,10 @@ func traceStackID(mp *m, buf []uintptr, skip int) uint64 {
gp := mp.curg gp := mp.curg
var nstk int var nstk int
if gp == _g_ { if gp == _g_ {
nstk = callers(skip+1, buf[:]) nstk = callers(skip+1, buf)
} else if gp != nil { } else if gp != nil {
gp = mp.curg gp = mp.curg
nstk = gcallers(gp, skip, buf[:]) nstk = gcallers(gp, skip, buf)
} }
if nstk > 0 { if nstk > 0 {
nstk-- // skip runtime.goexit nstk-- // skip runtime.goexit