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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.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 | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/constant/evaluation.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/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index a87c085386de557a0b5d861bd7726f0006ea8e2c..cde48256503cf6db6ad464f302aff23eddd68da5 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -3679,7 +3679,7 @@ class NodeLocator extends UnifyingAstVisitor<Object> {
*/
NodeLocator(int startOffset, [int endOffset])
: this._startOffset = startOffset,
- this._endOffset = endOffset == null ? startOffset : endOffset;
+ this._endOffset = endOffset ?? startOffset;
/**
* Return the node that was found that corresponds to the given source range
@@ -3783,7 +3783,7 @@ class NodeLocator2 extends UnifyingAstVisitor<Object> {
*/
NodeLocator2(int startOffset, [int endOffset])
: this._startOffset = startOffset,
- this._endOffset = endOffset == null ? startOffset : endOffset;
+ this._endOffset = endOffset ?? startOffset;
/**
* Search within the given AST [node] and return the node that was found,
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/constant/evaluation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698