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

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

Issue 16302002: analyzer_experimental snapshot (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/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
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java
index 184072d3f002b5bdad7a1712e7b9d88f0300de48..1a90b7d7f1ebedfab5d05dc2ca2a817af85f5bf4 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/visitor/BreadthFirstVisitor.java
@@ -16,7 +16,6 @@ package com.google.dart.engine.ast.visitor;
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,8 +26,7 @@ import java.util.List;
* @coverage dart.engine.ast
*/
public class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
-
- private List<ASTNode> queue = createQueue();
+ private final LinkedList<ASTNode> queue = new LinkedList<ASTNode>();
Brian Wilkerson 2013/06/01 19:46:58 createQueue might have been defined in order to al
messick 2013/06/01 21:32:10 Just so. Why delete it?
private GeneralizingASTVisitor<Void> childVisitor = new GeneralizingASTVisitor<Void>() {
@Override
@@ -46,7 +44,7 @@ public class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
public void visitAllNodes(ASTNode root) {
queue.add(root);
while (!queue.isEmpty()) {
- ASTNode next = queue.remove(0);
+ ASTNode next = queue.removeFirst();
messick 2013/06/01 21:32:10 None of these changes are needed, unless this is s
scheglov 2013/06/01 22:12:04 In Dart there are no direct replacement for Linked
next.accept(this);
}
}
@@ -56,8 +54,4 @@ public class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
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