summaryrefslogtreecommitdiff
path: root/chapter04/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'chapter04/src/main/java')
-rw-r--r--chapter04/src/main/java/com/seaofnodes/simple/node/Node.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/chapter04/src/main/java/com/seaofnodes/simple/node/Node.java b/chapter04/src/main/java/com/seaofnodes/simple/node/Node.java
index 2a4aad2f..4f196805 100644
--- a/chapter04/src/main/java/com/seaofnodes/simple/node/Node.java
+++ b/chapter04/src/main/java/com/seaofnodes/simple/node/Node.java
@@ -224,13 +224,13 @@ public abstract class Node {
* code. </li>
* </ul>
*/
- public final Node peephole( ) {
+ public final Node peephole() {
var obs = Parser.PARSER == null ? null : Parser.PARSER._obs;
- Type old = _type;
if( obs != null ) obs.before(this);
+ Type old = _type;
Node n = peepholeOpt();
Node rez = n == null ? this : n;
- if( obs != null ) obs.after(this, n != null || old != _type ? rez : null, false);
+ if( obs != null ) obs.after(this, n == null && old == _type ? null : rez, false);
return rez;
}