From b456931880c43fc63bb33b505065cb004b068c18 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Sat, 22 Jun 2024 20:32:28 -0400 Subject: [PATCH] .remove() does not need to trigger the cleanup() --- src/main/java/com/cedarsoftware/util/LRUCache.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/cedarsoftware/util/LRUCache.java b/src/main/java/com/cedarsoftware/util/LRUCache.java index 5295cc9d..777665df 100644 --- a/src/main/java/com/cedarsoftware/util/LRUCache.java +++ b/src/main/java/com/cedarsoftware/util/LRUCache.java @@ -111,7 +111,6 @@ public V put(K key, V value) { public V remove(Object key) { Node node = cache.remove(key); if (node != null) { - scheduleCleanup(); return node.value; } return null; @@ -170,7 +169,7 @@ public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Map)) return false; Map other = (Map) o; - return this.entrySet().equals(other.entrySet()); + return entrySet().equals(other.entrySet()); } @Override