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

Unified Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 1918923003: Remove unnecessary casts and general code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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/analysis_options_provider.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 8be0a41b658a3b034501ba2ec492024fec44c3a4..f539e2ed193549209e3d6ba4f9421ec6678dc7c6 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -315,9 +315,7 @@ class CacheEntry {
new HashMap<ResultDescriptor, ResultData>();
CacheEntry(this.target) {
- if (target is ElementImpl) {
- (target as ElementImpl).setModifier(Modifier.CACHE_KEY, true);
- }
+ _markAsCacheKey(target);
}
/**
@@ -632,6 +630,15 @@ class CacheEntry {
}
/**
+ * If the given `target` is an element, mark it as being a cache key.
+ */
+ void _markAsCacheKey(AnalysisTarget target) {
+ if (target is ElementImpl) {
+ target.setModifier(Modifier.CACHE_KEY, true);
+ }
+ }
+
+ /**
* Set the [dependedOn] on which this result depends.
*/
void _setDependedOnResults(ResultData thisData, TargetedResult thisResult,
« no previous file with comments | « pkg/analyzer/lib/source/analysis_options_provider.dart ('k') | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698