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