Commit 342764a2 authored by Iskander Sharipov's avatar Iskander Sharipov Committed by Bryan C. Mills

runtime/pprof/internal/profile: use idiomatic swapping

gogrep found only one such case with the pattern below:

	$tmp := $x; $x = $y; $y = $tmp

R=1.13

Change-Id: I6e46fb5ef2887f24fa9fc451323a8cef272e2886
Reviewed-on: https://go-review.googlesource.com/c/151200
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent d346a9b7
......@@ -211,9 +211,7 @@ func (p *Profile) setMain() {
continue
}
// Swap what we guess is main to position 0.
tmp := p.Mapping[i]
p.Mapping[i] = p.Mapping[0]
p.Mapping[0] = tmp
p.Mapping[i], p.Mapping[0] = p.Mapping[0], p.Mapping[i]
break
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment