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

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

Issue 1933763002: Use null-aware operators to clean up the code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Additional 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 | « no previous file | pkg/analyzer/lib/file_system/file_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 6fa9188a337b24e569aadfeb713848b31ea3d416..bd54ec59749723744e8cc8e230f1862664edfe9b 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -4467,8 +4467,8 @@ abstract class ImportDirective extends NamespaceDirective {
//
SimpleIdentifier prefix1 = import1.prefix;
SimpleIdentifier prefix2 = import2.prefix;
- String prefixStr1 = prefix1 != null ? prefix1.name : null;
- String prefixStr2 = prefix2 != null ? prefix2.name : null;
+ String prefixStr1 = prefix1?.name;
+ String prefixStr2 = prefix2?.name;
if (prefixStr1 != null || prefixStr2 != null) {
if (prefixStr1 == null) {
return -1;
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698