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

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

Issue 1918923003: Remove unnecessary casts and general code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: clean-up Created 4 years, 8 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 | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/dart/ast/utilities.dart » ('j') | 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 f1f31647506b5281c2fb3cb4fcbe5ea1c6bf7a60..18bb3be063c78c217b57ee5a39ac484defd8c4a7 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -772,8 +772,7 @@ class AssignmentExpressionImpl extends ExpressionImpl
if (leftElement is ExecutableElement) {
executableElement = leftElement;
}
- }
- if (_leftHandSide is PropertyAccess) {
+ } else if (_leftHandSide is PropertyAccess) {
SimpleIdentifier identifier =
(_leftHandSide as PropertyAccess).propertyName;
Element leftElement = identifier.propagatedElement;
@@ -808,8 +807,7 @@ class AssignmentExpressionImpl extends ExpressionImpl
if (leftElement is ExecutableElement) {
executableElement = leftElement;
}
- }
- if (_leftHandSide is PropertyAccess) {
+ } else if (_leftHandSide is PropertyAccess) {
Element leftElement =
(_leftHandSide as PropertyAccess).propertyName.staticElement;
if (leftElement is ExecutableElement) {
@@ -8914,11 +8912,9 @@ class SimpleIdentifierImpl extends IdentifierImpl implements SimpleIdentifier {
AstNode parent = this.parent;
if (parent is PrefixedIdentifier) {
return identical(parent.identifier, this);
- }
- if (parent is PropertyAccess) {
+ } else if (parent is PropertyAccess) {
return identical(parent.propertyName, this);
- }
- if (parent is MethodInvocation) {
+ } else if (parent is MethodInvocation) {
MethodInvocation invocation = parent;
return identical(invocation.methodName, this) &&
invocation.realTarget != null;
@@ -10563,7 +10559,7 @@ class VariableDeclarationImpl extends DeclarationImpl
super._childEntities..add(_name)..add(equals)..add(_initializer);
/**
- * This overridden implementation of getDocumentationComment() looks in the
+ * This overridden implementation of [documentationComment] looks in the
* grandparent node for Dartdoc comments if no documentation is specifically
* available on the node.
*/
@@ -10571,11 +10567,9 @@ class VariableDeclarationImpl extends DeclarationImpl
Comment get documentationComment {
Comment comment = super.documentationComment;
if (comment == null) {
- if (parent != null && parent.parent != null) {
- AstNode node = parent.parent;
- if (node is AnnotatedNode) {
- return node.documentationComment;
- }
+ AstNode node = parent?.parent;
+ if (node is AnnotatedNode) {
+ return node.documentationComment;
}
}
return comment;
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/dart/ast/utilities.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698