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

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/extract_local.dart

Issue 667463004: Code clean-up (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/analysis_server/lib/src/services/refactoring/extract_local.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
index 87250311d1021a14a23b617e9f6394a3abd4c4c9..0925b38a67100b5dc6e4079f6aabc50ef912c743 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
@@ -513,13 +513,13 @@ class _ExtractExpressionAnalyzer extends SelectionAnalyzer {
class _HasStatementVisitor extends GeneralizingAstVisitor {
- final List<bool> result;
+ bool result = false;
- _HasStatementVisitor(this.result);
+ _HasStatementVisitor();
@override
visitStatement(Statement node) {
- result[0] = true;
+ result = true;
}
}
@@ -579,9 +579,9 @@ class _OccurrencesVisitor extends GeneralizingAstVisitor<Object> {
}
bool _hasStatements(AstNode root) {
- List<bool> result = [false];
- root.accept(new _HasStatementVisitor(result));
- return result[0];
+ _HasStatementVisitor visitor = new _HasStatementVisitor();
+ root.accept(visitor);
+ return visitor.result;
}
void _tryToFindOccurrence(Expression node) {
« no previous file with comments | « pkg/analysis_server/lib/src/services/generated/util.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698