Mercurial > hg > graal-compiler
changeset 22387:8a0a21599dcc
Simplify code slightly
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Tue, 28 Jul 2015 10:52:41 -0700 |
parents | c59dda281fb6 |
children | 59a2f85de5c7 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java |
diffstat | 1 files changed, 9 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Tue Jul 28 10:49:20 2015 -0700 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Tue Jul 28 10:52:41 2015 -0700 @@ -111,18 +111,15 @@ return object(); } if (getGuard() != null) { - for (Node use : getGuard().asNode().usages()) { - if (use instanceof PiNode) { - PiNode otherPi = (PiNode) use; - if (object() == otherPi.object() && stamp().equals(otherPi.stamp())) { - /* - * Two PiNodes with the same guard and same result, so return the one with - * the more precise piStamp. - */ - Stamp newStamp = piStamp.join(otherPi.piStamp); - if (newStamp.equals(otherPi.piStamp)) { - return otherPi; - } + for (PiNode otherPi : getGuard().asNode().usages().filter(PiNode.class)) { + if (object() == otherPi.object() && stamp().equals(otherPi.stamp())) { + /* + * Two PiNodes with the same guard and same result, so return the one with the + * more precise piStamp. + */ + Stamp newStamp = piStamp.join(otherPi.piStamp); + if (newStamp.equals(otherPi.piStamp)) { + return otherPi; } } }