sonar 220219, criticals

This commit is contained in:
Ingmar Goudt 2019-02-22 12:05:44 +01:00
parent 4504ad5e6f
commit 3359c1f3f1
23 changed files with 153 additions and 280 deletions

View file

@ -164,10 +164,7 @@ public final class DeckBuilder {
}
}
if (count > 0) {
Integer typeCount = colorCount.get(symbol);
if (typeCount == null) {
typeCount = 0;
}
Integer typeCount = colorCount.getOrDefault(symbol, 0);
typeCount += 1;
colorCount.put(symbol, typeCount);
}
@ -243,9 +240,9 @@ public final class DeckBuilder {
int type;
if (card.isCreature()) {
type = 10;
} else if (card.getSubtype(null).contains(SubType.EQUIPMENT)) {
} else if (card.hasSubtype(SubType.EQUIPMENT, null)) {
type = 8;
} else if (card.getSubtype(null).contains(SubType.AURA)) {
} else if (card.hasSubtype(SubType.AURA, null)) {
type = 5;
} else if (card.isInstant()) {
type = 7;
@ -283,10 +280,7 @@ public final class DeckBuilder {
multicolor += 1;
colors.add(symbol);
}
Integer typeCount = singleCount.get(symbol);
if (typeCount == null) {
typeCount = 0;
}
Integer typeCount = singleCount.getOrDefault(symbol, 0);
typeCount += 1;
singleCount.put(symbol, typeCount);
maxSingleCount = Math.max(maxSingleCount, typeCount);