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

Method _walk

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

Source from the content-addressed store, hash-verified

619 }
620
621 private <E> E _walk( Function<Node,E> pred ) {
622 if( CODE._visit.get(_nid) ) return null; // Been there, done that
623 CODE._visit.set(_nid);
624 E x = pred.apply(this);
625 if( x != null ) return x;
626 for( Node def : _inputs ) if( def != null && (x = def._walk(pred)) != null ) return x;
627 for( Node use : _outputs ) if( use != null && (x = use._walk(pred)) != null ) return x;
628 return null;
629 }
630
631 /**
632 * 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