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

Unified Diff: pkg/analyzer/lib/src/context/cache.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/source/path_filter.dart ('k') | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/cache.dart
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart
index 7e6e0a05ef578a9c8ebc480f42bc7cc0676ccce3..c5641a9da605a258e3319b5db29c63ae42acc12b 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -514,7 +514,7 @@ class CacheEntry {
ResultData data = getResultData(descriptor);
_setDependedOnResults(data, thisResult, dependedOn);
data.state = CacheState.VALID;
- data.value = value == null ? descriptor.defaultValue : value;
+ data.value = value ?? descriptor.defaultValue;
}
/**
@@ -922,7 +922,7 @@ abstract class CachePartition {
*/
List<Source> getSourcesWithFullName(String path) {
List<Source> sources = pathToSource[path];
- return sources != null ? sources : Source.EMPTY_LIST;
+ return sources ?? Source.EMPTY_LIST;
}
/**
« no previous file with comments | « pkg/analyzer/lib/source/path_filter.dart ('k') | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698