| 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>();
|
| - }
|
| }
|
|
|