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

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

Issue 2653343002: Improve performance of visiting large invalid compilation units (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index d157276a2a9b958e73be3113ce17bf478723b4e6..8722aa42f02c12b3752fa1e645d748459470d91f 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -2522,9 +2522,10 @@ class CompilationUnitImpl extends AstNodeImpl implements CompilationUnit {
_directives.accept(visitor);
_declarations.accept(visitor);
} else {
- int length = sortedDirectivesAndDeclarations.length;
+ List<AstNode> sortedMembers = sortedDirectivesAndDeclarations;
+ int length = sortedMembers.length;
for (int i = 0; i < length; i++) {
- AstNode child = sortedDirectivesAndDeclarations[i];
+ AstNode child = sortedMembers[i];
child.accept(visitor);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698