Skip to content

Commit 707f888

Browse files
zcheegopherbot
authored andcommitted
cmd/compile/internal/pgo: gofmt and simplify
Change-Id: I29621cb6a3845917e7558be28579fe0e1b2d5afa Reviewed-on: https://go-review.googlesource.com/c/go/+/446776 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Keith Randall <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Keith Randall <[email protected]>
1 parent 3e44b7d commit 707f888

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cmd/compile/internal/pgo/irgraph.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func (p *Profile) PrintWeightedCallGraphDOT(edgeThreshold float64) {
380380

381381
// Determine nodes of DOT.
382382
nodes := make(map[string]*ir.Func)
383-
for name, _ := range funcs {
383+
for name := range funcs {
384384
if n, ok := p.WeightedCG.IRNodes[name]; ok {
385385
for _, e := range p.WeightedCG.OutEdges[n] {
386386
if _, ok := nodes[ir.PkgFuncName(e.Src.AST)]; !ok {
@@ -484,7 +484,7 @@ func (g *IRGraph) calculateWeight(parent *IRNode, cur *IRNode) int64 {
484484
sum := int64(0)
485485
pw := int64(0)
486486
for _, InEdge := range g.InEdges[cur] {
487-
sum = sum + InEdge.Weight
487+
sum += InEdge.Weight
488488
if InEdge.Src == parent {
489489
pw = InEdge.Weight
490490
}

0 commit comments

Comments
 (0)