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

Unified Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 677303002: Remove unnecessary List creation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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: pkg/analyzer/lib/src/generated/ast.dart
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index bb44db5d5b3ccdd49d072ada95d431440bd68955..414277cbb258f424b7bd94f5e0a5d3f53eeda18a 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -197,10 +197,9 @@ abstract class AnnotatedNode extends AstNode {
* appeared in the original source
*/
List<AstNode> get sortedCommentAndAnnotations {
- List<AstNode> childList = new List<AstNode>();
- childList.add(_comment);
- childList.addAll(_metadata);
- List<AstNode> children = new List.from(childList);
+ List<AstNode> children = new List<AstNode>();
+ children.add(_comment);
+ children.addAll(_metadata);
children.sort(AstNode.LEXICAL_ORDER);
return children;
sra1 2014/10/26 06:31:39 or return <AstNode>[] ..add(_comment) ..addA
Brian Wilkerson 2014/10/26 15:15:46 Done. I am more concerned at the moment about perf
}
@@ -4325,10 +4324,9 @@ class CompilationUnit extends AstNode {
* appeared in the original source
*/
List<AstNode> get sortedDirectivesAndDeclarations {
- List<AstNode> childList = new List<AstNode>();
- childList.addAll(_directives);
- childList.addAll(_declarations);
- List<AstNode> children = new List.from(childList);
+ List<AstNode> children = new List<AstNode>();
+ children.addAll(_directives);
+ children.addAll(_declarations);
children.sort(AstNode.LEXICAL_ORDER);
return children;
}
@@ -13231,10 +13229,9 @@ abstract class NormalFormalParameter extends FormalParameter {
* appeared in the original source
*/
List<AstNode> get sortedCommentAndAnnotations {
- List<AstNode> childList = new List<AstNode>();
- childList.add(_comment);
- childList.addAll(_metadata);
- List<AstNode> children = new List.from(childList);
+ List<AstNode> children = new List<AstNode>();
+ children.add(_comment);
+ children.addAll(_metadata);
children.sort(AstNode.LEXICAL_ORDER);
return children;
}

Powered by Google App Engine
This is Rietveld 408576698