Skip to content

Commit

Permalink
优化cache创建逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Dec 23, 2016
1 parent 6c76715 commit c3ac262
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.hswebframework.web.commons.beans.GenericBean;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public ConfigContent get(String key) {
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));
}
Expand Down

0 comments on commit c3ac262

Please sign in to comment.