change capacity

This commit is contained in:
Looly
2021-06-15 11:43:05 +08:00
parent 56703c5a55
commit fdede9070b
5 changed files with 222 additions and 16 deletions

View File

@@ -37,7 +37,7 @@ public class FIFOCache<K, V> extends AbstractCache<K, V> {
public FIFOCache(int capacity, long timeout) {
this.capacity = capacity;
this.timeout = timeout;
cacheMap = new LinkedHashMap<>(Math.max(1 << 4, capacity >>> 7), 1.0f, false);
cacheMap = new LinkedHashMap<>(capacity + 1, 1.0f, false);
}
/**