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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.context.cache; 5 library analyzer.src.context.cache;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/dart/element/element.dart' 10 import 'package:analyzer/src/dart/element/element.dart'
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 */ 308 */
309 int _flags = 0; 309 int _flags = 0;
310 310
311 /** 311 /**
312 * A table mapping result descriptors to the cached values of those results. 312 * A table mapping result descriptors to the cached values of those results.
313 */ 313 */
314 Map<ResultDescriptor, ResultData> _resultMap = 314 Map<ResultDescriptor, ResultData> _resultMap =
315 new HashMap<ResultDescriptor, ResultData>(); 315 new HashMap<ResultDescriptor, ResultData>();
316 316
317 CacheEntry(this.target) { 317 CacheEntry(this.target) {
318 _markAsCacheKey(target);
319 }
320
321 /**
322 * If the given `target` is an element, mark it as being a cache key.
323 */
324 void _markAsCacheKey(AnalysisTarget target) {
318 if (target is ElementImpl) { 325 if (target is ElementImpl) {
319 (target as ElementImpl).setModifier(Modifier.CACHE_KEY, true); 326 target.setModifier(Modifier.CACHE_KEY, true);
320 } 327 }
321 } 328 }
322 329
323 /** 330 /**
324 * The exception that caused one or more values to have a state of 331 * The exception that caused one or more values to have a state of
325 * [CacheState.ERROR]. 332 * [CacheState.ERROR].
326 */ 333 */
327 CaughtException get exception => _exception; 334 CaughtException get exception => _exception;
328 335
329 /** 336 /**
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 void resultAccessed(TargetedResult result) {} 1278 void resultAccessed(TargetedResult result) {}
1272 1279
1273 @override 1280 @override
1274 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1281 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1275 return TargetedResult.EMPTY_LIST; 1282 return TargetedResult.EMPTY_LIST;
1276 } 1283 }
1277 1284
1278 @override 1285 @override
1279 void targetRemoved(AnalysisTarget target) {} 1286 void targetRemoved(AnalysisTarget target) {}
1280 } 1287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698