diff options
Diffstat (limited to 'chapter07/src/main/java/com/seaofnodes')
| -rw-r--r-- | chapter07/src/main/java/com/seaofnodes/simple/node/ProjNode.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chapter07/src/main/java/com/seaofnodes/simple/node/ProjNode.java b/chapter07/src/main/java/com/seaofnodes/simple/node/ProjNode.java index c263502d..3c3f73b8 100644 --- a/chapter07/src/main/java/com/seaofnodes/simple/node/ProjNode.java +++ b/chapter07/src/main/java/com/seaofnodes/simple/node/ProjNode.java @@ -38,12 +38,8 @@ public class ProjNode extends Node { @Override public Node idealize() { - if( ctrl()._type instanceof TypeTuple tt ) { - if( tt._types[_idx]==Type.XCONTROL ) - return new ConstantNode(Type.XCONTROL).peephole(); // We are dead - if( tt._types[1-_idx]==Type.XCONTROL ) // Only true for IfNodes - return ctrl().in(0); // We become our input control - } + if( ctrl()._type instanceof TypeTuple tt && tt._types[1-_idx]==Type.XCONTROL ) // Only true for IfNodes + return ctrl().in(0); // We become our input control return null; } } |
