Skip to content

Commit

Permalink
use patch func
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed May 10, 2020
1 parent ec784bf commit f006ea4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions optimizer/fold.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ func (fold *fold) Exit(node *Node) {
// for IntegerNode the type may have been changed from int->float
// preserve this information by setting the type after the Patch
patchWithType := func(newNode Node, leafType reflect.Type) {
fold.applied = true
Patch(node, newNode)
patch(newNode)
newNode.SetType(leafType)
}

Expand Down

0 comments on commit f006ea4

Please sign in to comment.