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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java

Issue 16337007: Version 0.5.13.1 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java (revision 23549)
+++ editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java (working copy)
@@ -16,7 +16,6 @@
import com.google.dart.engine.ast.ASTNode;
import java.util.LinkedList;
-import java.util.List;
/**
* Instances of the class {@code BreadthFirstVisitor} implement an AST visitor that will recursively
@@ -27,9 +26,8 @@
* @coverage dart.engine.ast
*/
public class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
+ private final LinkedList<ASTNode> queue = new LinkedList<ASTNode>();
- private List<ASTNode> queue = createQueue();
-
private GeneralizingASTVisitor<Void> childVisitor = new GeneralizingASTVisitor<Void>() {
@Override
public Void visitNode(ASTNode node) {
@@ -46,7 +44,7 @@
public void visitAllNodes(ASTNode root) {
queue.add(root);
while (!queue.isEmpty()) {
- ASTNode next = queue.remove(0);
+ ASTNode next = queue.removeFirst();
next.accept(this);
}
}
@@ -56,8 +54,4 @@
node.visitChildren(childVisitor);
return null;
}
-
- protected List<ASTNode> createQueue() {
- return new LinkedList<ASTNode>();
- }
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698