aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIskander Sharipov <quasilyte@gmail.com>2018-07-10 08:32:56 +0300
committerBrad Fitzpatrick <bradfitz@golang.org>2018-08-22 19:48:50 +0000
commitfd7d3259c93e8901f5645fd5de620cd75053c7ca (patch)
tree751cc780851a5455ac95e277c08ae734ef931efa /src
parentfa6639d62664ecd710b112eb1c1e759104c9193c (diff)
downloadgo-fd7d3259c93e8901f5645fd5de620cd75053c7ca.tar.xz
runtime: remove redundant explicit deref in trace.go
Replaces legacy Go syntax for pointer struct member access with more modern auto-deref alternative. Found using https://go-critic.github.io/overview#underef-ref Change-Id: I71a3c424126c4ff5d89f9e4bacb6cc01c6fa2ddf Reviewed-on: https://go-review.googlesource.com/122895 Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/trace.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/trace.go b/src/runtime/trace.go
index 22d8d026dc..08e92d2efe 100644
--- a/src/runtime/trace.go
+++ b/src/runtime/trace.go
@@ -532,12 +532,12 @@ func traceEvent(ev byte, skip int, args ...uint64) {
}
func traceEventLocked(extraBytes int, mp *m, pid int32, bufp *traceBufPtr, ev byte, skip int, args ...uint64) {
- buf := (*bufp).ptr()
+ buf := bufp.ptr()
// TODO: test on non-zero extraBytes param.
maxSize := 2 + 5*traceBytesPerNumber + extraBytes // event type, length, sequence, timestamp, stack id and two add params
if buf == nil || len(buf.arr)-buf.pos < maxSize {
buf = traceFlush(traceBufPtrOf(buf), pid).ptr()
- (*bufp).set(buf)
+ bufp.set(buf)
}
ticks := uint64(cputicks()) / traceTickDiv
@@ -689,11 +689,11 @@ func traceString(bufp *traceBufPtr, pid int32, s string) (uint64, *traceBufPtr)
// so there must be no memory allocation or any activities
// that causes tracing after this point.
- buf := (*bufp).ptr()
+ buf := bufp.ptr()
size := 1 + 2*traceBytesPerNumber + len(s)
if buf == nil || len(buf.arr)-buf.pos < size {
buf = traceFlush(traceBufPtrOf(buf), pid).ptr()
- (*bufp).set(buf)
+ bufp.set(buf)
}
buf.byte(traceEvString)
buf.varint(id)
@@ -708,7 +708,7 @@ func traceString(bufp *traceBufPtr, pid int32, s string) (uint64, *traceBufPtr)
buf.varint(uint64(slen))
buf.pos += copy(buf.arr[buf.pos:], s[:slen])
- (*bufp).set(buf)
+ bufp.set(buf)
return id, bufp
}
@@ -1206,7 +1206,7 @@ func trace_userLog(id uint64, category, message string) {
traceEventLocked(extraSpace, mp, pid, bufp, traceEvUserLog, 3, id, categoryID)
// traceEventLocked reserved extra space for val and len(val)
// in buf, so buf now has room for the following.
- buf := (*bufp).ptr()
+ buf := bufp.ptr()
// double-check the message and its length can fit.
// Otherwise, truncate the message.