Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java

Issue 9600049: Use NodeList where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java b/compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java
index e3cf4b8c9d7cc07ad9e7e7dbf0e41a4659ef5c7d..690b6140234fefbf7c47263a37153af19f61fc0d 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java
@@ -11,16 +11,12 @@ import java.util.List;
*/
public abstract class DartSwitchMember extends DartNode {
- private final List<DartStatement> statements;
+ private final NodeList<DartStatement> statements = NodeList.create(this);
private final DartLabel label;
public DartSwitchMember(DartLabel label, List<DartStatement> statements) {
this.label = becomeParentOf(label);
- this.statements = becomeParentOf(statements);
- }
-
- public void addStatement(DartStatement statement) {
- statements.add(statement);
+ this.statements.addAll(statements);
}
public List<DartStatement> getStatements() {
@@ -36,6 +32,6 @@ public abstract class DartSwitchMember extends DartNode {
if (label != null) {
label.accept(visitor);
}
- visitor.visit(statements);
+ statements.accept(visitor);
}
}

Powered by Google App Engine
This is Rietveld 408576698