MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / _walk

Method _walk

chapter17/src/main/java/com/seaofnodes/simple/node/Node.java:630–638  ·  view source on GitHub ↗
( Function<Node,E> pred )

Source from the content-addressed store, hash-verified

628 }
629
630 private <E> E _walk( Function<Node,E> pred ) {
631 if( WVISIT.get(_nid) ) return null; // Been there, done that
632 WVISIT.set(_nid);
633 E x = pred.apply(this);
634 if( x != null ) return x;
635 for( Node def : _inputs ) if( def != null && (x = def._walk(pred)) != null ) return x;
636 for( Node use : _outputs ) if( use != null && (x = use._walk(pred)) != null ) return x;
637 return null;
638 }
639
640 /**
641 * Debugging utility to find a Node by index

Callers 1

walkMethod · 0.95

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected