From 028700efe0345e764f598378cb64c5e57f980e33 Mon Sep 17 00:00:00 2001 From: Rene Treffer Date: Fri, 13 Jun 2014 17:54:54 +0200 Subject: [PATCH] Make sure we initialize big enough if s.o. chooses small values --- src/main/java/de/measite/minidns/LRUCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/measite/minidns/LRUCache.java b/src/main/java/de/measite/minidns/LRUCache.java index 132bf7946..0262e4c5f 100644 --- a/src/main/java/de/measite/minidns/LRUCache.java +++ b/src/main/java/de/measite/minidns/LRUCache.java @@ -48,7 +48,7 @@ public class LRUCache implements DNSCache { this.capacity = capacity; this.maxTTL = maxTTL; backend = new LinkedHashMap( - Math.min(capacity, 11), 0.75f, true) + Math.min(capacity + (capacity + 3) / 4 + 2, 11), 0.75f, true) { @Override protected boolean removeEldestEntry(