File tree Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 11package compiler
22
3- import "reflect"
4-
53// Visitor
64
75type Visitor func (* Node ) bool
@@ -22,12 +20,6 @@ func visitNodes(v Visitor, nodes []*Node) bool {
2220 return false
2321}
2422
25- // In situations where conversions from a pointer type may produce a typed nil, this function can be used
26- // to check that the interface truly references an existing struct.
27- func exists (i interface {}) bool {
28- return ! (i == nil || reflect .ValueOf (i ).IsNil ())
29- }
30-
3123// NodeFactory
3224
3325type NodeFactory struct {
Original file line number Diff line number Diff line change @@ -572,7 +572,7 @@ func finishFlowLabel(label *FlowLabel) *FlowNode {
572572}
573573
574574func (b * Binder ) bind (node * Node ) bool {
575- if ! exists ( node ) {
575+ if node == nil {
576576 return false
577577 }
578578 node .parent = b .parent
Original file line number Diff line number Diff line change @@ -1000,7 +1000,7 @@ func isClassLike(node *Node) bool {
10001000}
10011001
10021002func declarationNameToString (name * Node ) string {
1003- if ! exists ( name ) || name .Pos () == name .End () {
1003+ if name == nil || name .Pos () == name .End () {
10041004 return "(Missing)"
10051005 }
10061006 return getTextOfNode (name )
You can’t perform that action at this time.
0 commit comments