From 5246df6b504a8afa9b7a5267da3dd6a92091036f Mon Sep 17 00:00:00 2001 From: LamGC Date: Fri, 1 Jan 2021 10:03:26 +0800 Subject: [PATCH] =?UTF-8?q?[Change]=20CacheStore-Local=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=B8=8D=E5=8F=AF=E8=83=BD=E6=9D=A1=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Change] HashCacheStore 删除不可能条件(Hashtable 在 put 中已经进行了 Null 检查); --- .../main/java/net/lamgc/cgj/bot/cache/local/HashCacheStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ContentGrabbingJi-CacheStore-local/src/main/java/net/lamgc/cgj/bot/cache/local/HashCacheStore.java b/ContentGrabbingJi-CacheStore-local/src/main/java/net/lamgc/cgj/bot/cache/local/HashCacheStore.java index 2e644ac..daf4633 100644 --- a/ContentGrabbingJi-CacheStore-local/src/main/java/net/lamgc/cgj/bot/cache/local/HashCacheStore.java +++ b/ContentGrabbingJi-CacheStore-local/src/main/java/net/lamgc/cgj/bot/cache/local/HashCacheStore.java @@ -109,7 +109,7 @@ public abstract class HashCacheStore implements CacheStore, Cleanable { AtomicLong cleanCount = new AtomicLong(0); cacheMap.keySet().removeIf(key -> { CacheItem item = cacheMap.get(key); - if (item != null && item.isExpire(currentDate)) { + if (item.isExpire(currentDate)) { cleanCount.incrementAndGet(); return true; }