From: Iskander Sharipov Date: Mon, 26 Nov 2018 08:40:32 +0000 (+0300) Subject: runtime/pprof/internal/profile: use idiomatic swapping X-Git-Tag: go1.13beta1~1256 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=342764a21606ba6f964400cc747ee6c9a88fc959;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- diff --git a/src/runtime/pprof/internal/profile/profile.go b/src/runtime/pprof/internal/profile/profile.go index a6f8354b1e..443accdd6d 100644 --- a/src/runtime/pprof/internal/profile/profile.go +++ b/src/runtime/pprof/internal/profile/profile.go @@ -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 } }