mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-01 10:21:26 +08:00
优化cache创建逻辑
This commit is contained in:
@@ -21,7 +21,6 @@ package org.hswebframework.web.bean.config;
|
||||
|
||||
import org.hswebframework.web.commons.beans.GenericBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -91,7 +91,9 @@ public class SimpleConfigBean extends SimpleGenericBean<String> implements Confi
|
||||
if (cache == null) {
|
||||
synchronized (this) {
|
||||
if (cache == null) {
|
||||
if (content == null || content.isEmpty()) cache = new HashMap<>();
|
||||
if (content == null || content.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
cache = content.stream()
|
||||
.collect(Collectors.toMap(ConfigContent::getKey, content -> content));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user