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

Unified Diff: pkg/analysis_server/lib/src/services/correction/assist_internal.dart

Issue 696003002: Remove unnecessary cast in Quick Assist. (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
« 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/analysis_server/lib/src/services/correction/assist_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 2034c5431992a63811702eaef18392abab0ec19c..4358dd38c260dc27a6bf7b095461ccd61c5e08b9 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -1130,11 +1130,9 @@ class AssistProcessor {
}
// returns
if (thenStatement is ReturnStatement && elseStatement is ReturnStatement) {
- ReturnStatement thenReturn = thenStatement as ReturnStatement;
- ReturnStatement elseReturn = elseStatement as ReturnStatement;
String conditionSrc = _getNodeText(ifStatement.condition);
- String theSrc = _getNodeText(thenReturn.expression);
- String elseSrc = _getNodeText(elseReturn.expression);
+ String theSrc = _getNodeText(thenStatement.expression);
+ String elseSrc = _getNodeText(elseStatement.expression);
_addReplaceEdit(
rangeNode(ifStatement),
'return $conditionSrc ? $theSrc : $elseSrc;');
« 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