Commit e668000c authored by yanzg's avatar yanzg

提交数据

parent a93edcf7
...@@ -89,7 +89,11 @@ public class MemoryCache<T> { ...@@ -89,7 +89,11 @@ public class MemoryCache<T> {
if (this.isAutoClear && this.clearSecond < 1) { if (this.isAutoClear && this.clearSecond < 1) {
return data; return data;
} }
MemoryCacheItem<T> item = cache.getOrDefault(key, new MemoryCacheItem<T>()); MemoryCacheItem<T> item = cache.containsKey(key) ? cache.get(key) : null;
if (item == null) {
item = new MemoryCacheItem<T>();
cache.put(key, item);
}
item.setData(data); item.setData(data);
if (StringHelper.isEmpty(item.getName())) { if (StringHelper.isEmpty(item.getName())) {
item.setName(key); item.setName(key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment