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

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

Issue 2298043002: Revert "Flush AST results for source outside of the analysis roots." (Closed)
Patch Set: Created 4 years, 4 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/analysis_server/test/domain_completion_test.dart ('k') | pkg/analyzer/test/src/context/cache_test.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 d55d2fd18823dc8563dc17de26345d15b23cba64..532764f3b662736857a6520f0a40792278c15a66 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -27,11 +27,6 @@ typedef bool FlushResultFilter<V>(
AnalysisTarget target, ResultDescriptor<V> result);
/**
- * Return `true` if some results of the [target] should be flushed.
- */
-typedef bool FlushTargetFilter<V>(AnalysisTarget target);
-
-/**
* Return `true` if the given [target] is a priority one.
*/
typedef bool IsPriorityAnalysisTarget(AnalysisTarget target);
@@ -118,11 +113,11 @@ class AnalysisCache {
}
/**
- * Flush results that satisfy the given [targetFilter] and [resultFilter].
+ * Flush results that satisfy the given [filter].
*/
- void flush(FlushTargetFilter targetFilter, FlushResultFilter resultFilter) {
+ void flush(FlushResultFilter filter) {
for (CachePartition partition in _partitions) {
- partition.flush(targetFilter, resultFilter);
+ partition.flush(filter);
}
}
@@ -410,18 +405,14 @@ class CacheEntry {
}
/**
- * Flush results that satisfy the given [targetFilter] and [resultFilter].
+ * Flush results that satisfy the given [filter].
*/
- void flush(FlushTargetFilter targetFilter, FlushResultFilter resultFilter) {
- if (targetFilter(target)) {
- _resultMap.forEach((ResultDescriptor result, ResultData data) {
- if (data.state == CacheState.VALID) {
- if (resultFilter(target, result)) {
- data.flush();
- }
- }
- });
- }
+ void flush(FlushResultFilter filter) {
+ _resultMap.forEach((ResultDescriptor result, ResultData data) {
+ if (filter(target, result)) {
+ data.flush();
+ }
+ });
}
/**
@@ -1102,11 +1093,11 @@ abstract class CachePartition {
}
/**
- * Flush results that satisfy the given [targetFilter] and [resultFilter].
+ * Flush results that satisfy the given [filter].
*/
- void flush(FlushTargetFilter targetFilter, FlushResultFilter resultFilter) {
+ void flush(FlushResultFilter filter) {
for (CacheEntry entry in entryMap.values) {
- entry.flush(targetFilter, resultFilter);
+ entry.flush(filter);
}
}
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | pkg/analyzer/test/src/context/cache_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698