()
| 559 | private <E> E _walk( Function<Node,E> pred ) { |
| 560 | if( WVISIT.get(_nid) ) return null; // Been there, done that |
| 561 | WVISIT.set(_nid); |
| 562 | E x = pred.apply(this); |
| 563 | if( x != null ) return x; |
| 564 | for( Node def : _inputs ) if( def != null && (x = def._walk(pred)) != null ) return x; |
| 565 | for( Node use : _outputs ) if( use != null && (x = use._walk(pred)) != null ) return x; |
| 566 | return null; |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Debugging utility to find a Node by index |