diff options
| author | Koichi Shiraishi <zchee.io@gmail.com> | 2022-11-01 08:19:34 +0900 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-01-23 23:36:10 +0000 |
| commit | 707f888797c6d37cf5da85e666e992d45f973150 (patch) | |
| tree | 8203545e96e81b900ce2a8e55fb5fbf919e59774 /src/cmd | |
| parent | 3e44b7d07a7b3c6233eb1bf4cf3cb00a0b85adec (diff) | |
| download | go-707f888797c6d37cf5da85e666e992d45f973150.tar.xz | |
cmd/compile/internal/pgo: gofmt and simplify
Change-Id: I29621cb6a3845917e7558be28579fe0e1b2d5afa
Reviewed-on: https://go-review.googlesource.com/c/go/+/446776
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/compile/internal/pgo/irgraph.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/pgo/irgraph.go b/src/cmd/compile/internal/pgo/irgraph.go index 8177cf855e..ca9e2f3b5a 100644 --- a/src/cmd/compile/internal/pgo/irgraph.go +++ b/src/cmd/compile/internal/pgo/irgraph.go @@ -380,7 +380,7 @@ func (p *Profile) PrintWeightedCallGraphDOT(edgeThreshold float64) { // Determine nodes of DOT. nodes := make(map[string]*ir.Func) - for name, _ := range funcs { + for name := range funcs { if n, ok := p.WeightedCG.IRNodes[name]; ok { for _, e := range p.WeightedCG.OutEdges[n] { if _, ok := nodes[ir.PkgFuncName(e.Src.AST)]; !ok { @@ -484,7 +484,7 @@ func (g *IRGraph) calculateWeight(parent *IRNode, cur *IRNode) int64 { sum := int64(0) pw := int64(0) for _, InEdge := range g.InEdges[cur] { - sum = sum + InEdge.Weight + sum += InEdge.Weight if InEdge.Src == parent { pw = InEdge.Weight } |
