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); |
} |
} |