code refactoring
This commit is contained in:
parent
bcb1fa2e56
commit
2d3ddef181
9 changed files with 62 additions and 62 deletions
|
@ -133,7 +133,7 @@ public class SREntityType {
|
|||
|
||||
@SuppressWarnings("unused")
|
||||
public Double getTotalItemAttribute(Attribute attribute) {
|
||||
if (itemAttributes == null) itemAttributes = new HashMap<>();
|
||||
if (itemAttributes == null) itemAttributes = new EnumMap<>(Attribute.class);
|
||||
return itemAttributes.getOrDefault(attribute, new HashMap<>()).values().stream()
|
||||
.reduce(0.0, Double::sum);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue