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

Unified Diff: pkg/analyzer/lib/src/context/source.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/context/context.dart ('k') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/source.dart
diff --git a/pkg/analyzer/lib/src/context/source.dart b/pkg/analyzer/lib/src/context/source.dart
index 3a22291e45fa8e55b1b0b853047a97e16c98273d..32792df81f036f03d3621acfd27d54c6115fda9a 100644
--- a/pkg/analyzer/lib/src/context/source.dart
+++ b/pkg/analyzer/lib/src/context/source.dart
@@ -53,9 +53,8 @@ class SourceFactoryImpl implements SourceFactory {
*/
SourceFactoryImpl(this.resolvers,
[this._packages, ResourceProvider resourceProvider])
- : _resourceProvider = resourceProvider != null
- ? resourceProvider
- : PhysicalResourceProvider.INSTANCE;
+ : _resourceProvider =
+ resourceProvider ?? PhysicalResourceProvider.INSTANCE;
/**
* Return the [DartSdk] associated with this [SourceFactory], or `null` if
@@ -105,7 +104,7 @@ class SourceFactoryImpl implements SourceFactory {
// Default to the PackageMapUriResolver.
PackageMapUriResolver resolver = resolvers
.firstWhere((r) => r is PackageMapUriResolver, orElse: () => null);
- return resolver != null ? resolver.packageMap : null;
+ return resolver?.packageMap;
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698