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

Method _walk

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

Source from the content-addressed store, hash-verified

603 }
604
605 private <E> E _walk( Function<Node,E> pred ) {
606 if( WVISIT.get(_nid) ) return null; // Been there, done that
607 WVISIT.set(_nid);
608 E x = pred.apply(this);
609 if( x != null ) return x;
610 for( Node def : _inputs ) if( def != null && (x = def._walk(pred)) != null ) return x;
611 for( Node use : _outputs ) if( use != null && (x = use._walk(pred)) != null ) return x;
612 return null;
613 }
614
615 /**
616 * 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