Skip to content

Commit

Permalink
cmd/compile/internal/pgo: gofmt and simplify
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zchee authored and gopherbot committed Jan 23, 2023
1 parent 3e44b7d commit 707f888
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/pgo/irgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 707f888

Please sign in to comment.