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

Unified Diff: pkg/analyzer/lib/src/generated/sdk.dart

Issue 2020293004: Conditionally enable SDK summaries in server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/element/handle.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/sdk.dart
diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart
index 6f50b44c1185a0d6cbcbc8b44c08f597c511b899..feadee663b33a1783290a16d8c90971a96027ec5 100644
--- a/pkg/analyzer/lib/src/generated/sdk.dart
+++ b/pkg/analyzer/lib/src/generated/sdk.dart
@@ -124,12 +124,7 @@ class DartSdkManager {
*/
DartSdk getSdkForOptions(AnalysisOptions options) {
int encoding = options.encodeCrossContextOptions();
- DartSdk sdk = sdkMap[encoding];
- if (sdk == null) {
- sdk = sdkCreator(options);
- sdkMap[encoding] = sdk;
- }
- return sdk;
+ return sdkMap.putIfAbsent(encoding, () => sdkCreator(options));
Brian Wilkerson 2016/06/01 04:16:51 This is just code clean-up. I'm happy to back it o
pquitslund 2016/06/01 04:28:17 I'm all of keeping it. Yay for opportunistic clea
}
}
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698