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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 /** 192 /**
193 * Return an array containing the comment and annotations associated with this node, sorted in 193 * Return an array containing the comment and annotations associated with this node, sorted in
194 * lexical order. 194 * lexical order.
195 * 195 *
196 * @return the comment and annotations associated with this node in the order in which they 196 * @return the comment and annotations associated with this node in the order in which they
197 * appeared in the original source 197 * appeared in the original source
198 */ 198 */
199 List<AstNode> get sortedCommentAndAnnotations { 199 List<AstNode> get sortedCommentAndAnnotations {
200 List<AstNode> childList = new List<AstNode>(); 200 List<AstNode> children = new List<AstNode>();
201 childList.add(_comment); 201 children.add(_comment);
202 childList.addAll(_metadata); 202 children.addAll(_metadata);
203 List<AstNode> children = new List.from(childList);
204 children.sort(AstNode.LEXICAL_ORDER); 203 children.sort(AstNode.LEXICAL_ORDER);
205 return children; 204 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
206 } 205 }
207 } 206 }
208 207
209 /** 208 /**
210 * Instances of the class `Annotation` represent an annotation that can be assoc iated with an 209 * Instances of the class `Annotation` represent an annotation that can be assoc iated with an
211 * AST node. 210 * AST node.
212 * 211 *
213 * <pre> 212 * <pre>
214 * metadata ::= 213 * metadata ::=
215 * annotation* 214 * annotation*
(...skipping 4102 matching lines...) Expand 10 before | Expand all | Expand 10 after
4318 } 4317 }
4319 4318
4320 /** 4319 /**
4321 * Return an array containing all of the directives and declarations in this c ompilation unit, 4320 * Return an array containing all of the directives and declarations in this c ompilation unit,
4322 * sorted in lexical order. 4321 * sorted in lexical order.
4323 * 4322 *
4324 * @return the directives and declarations in this compilation unit in the ord er in which they 4323 * @return the directives and declarations in this compilation unit in the ord er in which they
4325 * appeared in the original source 4324 * appeared in the original source
4326 */ 4325 */
4327 List<AstNode> get sortedDirectivesAndDeclarations { 4326 List<AstNode> get sortedDirectivesAndDeclarations {
4328 List<AstNode> childList = new List<AstNode>(); 4327 List<AstNode> children = new List<AstNode>();
4329 childList.addAll(_directives); 4328 children.addAll(_directives);
4330 childList.addAll(_declarations); 4329 children.addAll(_declarations);
4331 List<AstNode> children = new List.from(childList);
4332 children.sort(AstNode.LEXICAL_ORDER); 4330 children.sort(AstNode.LEXICAL_ORDER);
4333 return children; 4331 return children;
4334 } 4332 }
4335 } 4333 }
4336 4334
4337 /** 4335 /**
4338 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that 4336 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that
4339 * declare a name within the scope of a compilation unit. 4337 * declare a name within the scope of a compilation unit.
4340 * 4338 *
4341 * <pre> 4339 * <pre>
(...skipping 8882 matching lines...) Expand 10 before | Expand all | Expand 10 after
13224 } 13222 }
13225 13223
13226 /** 13224 /**
13227 * Return an array containing the comment and annotations associated with this parameter, sorted 13225 * Return an array containing the comment and annotations associated with this parameter, sorted
13228 * in lexical order. 13226 * in lexical order.
13229 * 13227 *
13230 * @return the comment and annotations associated with this parameter in the o rder in which they 13228 * @return the comment and annotations associated with this parameter in the o rder in which they
13231 * appeared in the original source 13229 * appeared in the original source
13232 */ 13230 */
13233 List<AstNode> get sortedCommentAndAnnotations { 13231 List<AstNode> get sortedCommentAndAnnotations {
13234 List<AstNode> childList = new List<AstNode>(); 13232 List<AstNode> children = new List<AstNode>();
13235 childList.add(_comment); 13233 children.add(_comment);
13236 childList.addAll(_metadata); 13234 children.addAll(_metadata);
13237 List<AstNode> children = new List.from(childList);
13238 children.sort(AstNode.LEXICAL_ORDER); 13235 children.sort(AstNode.LEXICAL_ORDER);
13239 return children; 13236 return children;
13240 } 13237 }
13241 } 13238 }
13242 13239
13243 /** 13240 /**
13244 * Instances of the class `NullLiteral` represent a null literal expression. 13241 * Instances of the class `NullLiteral` represent a null literal expression.
13245 * 13242 *
13246 * <pre> 13243 * <pre>
13247 * nullLiteral ::= 13244 * nullLiteral ::=
(...skipping 6460 matching lines...) Expand 10 before | Expand all | Expand 10 after
19708 _elements[index] = node; 19705 _elements[index] = node;
19709 } 19706 }
19710 void clear() { 19707 void clear() {
19711 _elements = <E> []; 19708 _elements = <E> [];
19712 } 19709 }
19713 int get length => _elements.length; 19710 int get length => _elements.length;
19714 void set length(int value) { 19711 void set length(int value) {
19715 throw new UnsupportedError("Cannot resize NodeList."); 19712 throw new UnsupportedError("Cannot resize NodeList.");
19716 } 19713 }
19717 } 19714 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698