| 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 a3d22bef7c9d63c87cbce44c747dcd18c391d6f7..fc188ba1ec20ce9f7213c8b3c7536cac67adc211 100644
|
| --- a/pkg/analyzer/lib/src/context/cache.dart
|
| +++ b/pkg/analyzer/lib/src/context/cache.dart
|
| @@ -657,6 +657,9 @@ class CacheFlushManager<T> {
|
| * Records that the given [result] was just read from the cache.
|
| */
|
| void resultAccessed(TargetedResult result) {
|
| + if (maxSize <= 0) {
|
| + return;
|
| + }
|
| if (recentlyUsed.remove(result)) {
|
| recentlyUsed.add(result);
|
| }
|
| @@ -667,6 +670,9 @@ class CacheFlushManager<T> {
|
| * Returns [TargetedResult]s that should be flushed from the cache.
|
| */
|
| List<TargetedResult> resultStored(TargetedResult newResult, T newValue) {
|
| + if (maxSize <= 0) {
|
| + return TargetedResult.EMPTY_LIST;
|
| + }
|
| if (!recentlyUsed.remove(newResult)) {
|
| int size = policy.measure(newValue);
|
| resultSizeMap[newResult] = size;
|
|
|