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

Method _walk

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

Source from the content-addressed store, hash-verified

638 }
639
640 private <E> E _walk( Function<Node,E> pred ) {
641 if( WVISIT.get(_nid) ) return null; // Been there, done that
642 WVISIT.set(_nid);
643 E x = pred.apply(this);
644 if( x != null ) return x;
645 for( Node def : _inputs ) if( def != null && (x = def._walk(pred)) != null ) return x;
646 for( Node use : _outputs ) if( use != null && (x = use._walk(pred)) != null ) return x;
647 return null;
648 }
649
650 /**
651 * 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