mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
Cache.put变更策略,对于替换的键值对,不清理队列
This commit is contained in:
@@ -92,13 +92,12 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
|
||||
if (cacheMap.containsKey(mKey)) {
|
||||
// 存在相同key,覆盖之
|
||||
cacheMap.put(mKey, co);
|
||||
return;
|
||||
} else {
|
||||
if (isFull()) {
|
||||
pruneCache();
|
||||
}
|
||||
cacheMap.put(mKey, co);
|
||||
}
|
||||
|
||||
if (isFull()) {
|
||||
pruneCache();
|
||||
}
|
||||
cacheMap.put(mKey, co);
|
||||
}
|
||||
// ---------------------------------------------------------------- put end
|
||||
|
||||
|
Reference in New Issue
Block a user