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

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: 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
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..0dcac1de80174d7b95ed67476e8e449575b6a14c 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -315,8 +315,15 @@ class CacheEntry {
new HashMap<ResultDescriptor, ResultData>();
CacheEntry(this.target) {
+ _markAsCacheKey(target);
+ }
+
+ /**
+ * If the given `target` is an element, mark it as being a cache key.
+ */
+ void _markAsCacheKey(AnalysisTarget target) {
if (target is ElementImpl) {
- (target as ElementImpl).setModifier(Modifier.CACHE_KEY, true);
+ target.setModifier(Modifier.CACHE_KEY, true);
}
}

Powered by Google App Engine
This is Rietveld 408576698