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

Side by Side Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 1977413002: Improve type information and minor 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
« no previous file with comments | « pkg/analyzer/lib/source/error_processor.dart ('k') | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 * 172 *
173 * It does not update the cache, if the corresponding [CacheEntry] does not 173 * It does not update the cache, if the corresponding [CacheEntry] does not
174 * exist, then the default value is returned. 174 * exist, then the default value is returned.
175 */ 175 */
176 Object/*=V*/ getValue/*<V>*/( 176 Object/*=V*/ getValue/*<V>*/(
177 AnalysisTarget target, ResultDescriptor/*<V>*/ result) { 177 AnalysisTarget target, ResultDescriptor/*<V>*/ result) {
178 CacheEntry entry = get(target); 178 CacheEntry entry = get(target);
179 if (entry == null) { 179 if (entry == null) {
180 return result.defaultValue; 180 return result.defaultValue;
181 } 181 }
182 return entry.getValue(result) as Object/*=V*/; 182 return entry.getValue(result);
183 } 183 }
184 184
185 /** 185 /**
186 * Return an iterator returning all of the map entries mapping targets to 186 * Return an iterator returning all of the map entries mapping targets to
187 * cache entries. If the [context] is not `null`, then only entries that are 187 * cache entries. If the [context] is not `null`, then only entries that are
188 * owned by the given context will be returned. 188 * owned by the given context will be returned.
189 */ 189 */
190 MapIterator<AnalysisTarget, CacheEntry> iterator( 190 MapIterator<AnalysisTarget, CacheEntry> iterator(
191 {InternalAnalysisContext context: null}) { 191 {InternalAnalysisContext context: null}) {
192 List<Map<AnalysisTarget, CacheEntry>> maps = 192 List<Map<AnalysisTarget, CacheEntry>> maps =
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 void resultAccessed(TargetedResult result) {} 1279 void resultAccessed(TargetedResult result) {}
1280 1280
1281 @override 1281 @override
1282 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1282 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1283 return TargetedResult.EMPTY_LIST; 1283 return TargetedResult.EMPTY_LIST;
1284 } 1284 }
1285 1285
1286 @override 1286 @override
1287 void targetRemoved(AnalysisTarget target) {} 1287 void targetRemoved(AnalysisTarget target) {}
1288 } 1288 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/source/error_processor.dart ('k') | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698