summaryrefslogtreecommitdiff
path: root/chapter05
diff options
context:
space:
mode:
authordibyendumajumdar <mobile@majumdar.org.uk>2023-10-28 17:49:07 +0100
committerDibyendu Majumdar <dibyendumajumdar@users.noreply.github.com>2023-11-01 18:56:50 +0000
commitcbb6ca2a54e60e69316fc7b5b3c5a80bfd4c99b8 (patch)
treee8223d81fa5ecad5a79af97ef8ae1f324040d31c /chapter05
parent65cc1fa45d695266ad51252f7427ad8e9ab5ba04 (diff)
downloadSimple-cbb6ca2a54e60e69316fc7b5b3c5a80bfd4c99b8.tar.gz
Simple-cbb6ca2a54e60e69316fc7b5b3c5a80bfd4c99b8.zip
Remove id as we already have it in Node.
Diffstat (limited to 'chapter05')
-rw-r--r--chapter05/src/main/java/com/seaofnodes/simple/node/ScopeNode.java13
1 files changed, 1 insertions, 12 deletions
diff --git a/chapter05/src/main/java/com/seaofnodes/simple/node/ScopeNode.java b/chapter05/src/main/java/com/seaofnodes/simple/node/ScopeNode.java
index 5ac42c43..517ada00 100644
--- a/chapter05/src/main/java/com/seaofnodes/simple/node/ScopeNode.java
+++ b/chapter05/src/main/java/com/seaofnodes/simple/node/ScopeNode.java
@@ -17,19 +17,8 @@ public class ScopeNode extends Node {
*/
public final Stack<HashMap<String, Integer>> _scopes = new Stack<>();
- /**
- * We duplicate ScopeNodes when branches occur, so it is useful to have
- * a unique name for each ScopeNode; this helps when we want to visualize the
- * graph
- */
- private int _id;
-
- private static int _idCounter = 0;
-
- public ScopeNode() { _id = _idCounter++; }
-
@Override
- public String label() { return "Scope" + _id; }
+ public String label() { return "Scope" + _nid; }
@Override
StringBuilder _print1(StringBuilder sb) {