Minor adjustment to getArtCount implementation.

This commit is contained in:
leriomaggio
2021-08-11 08:16:21 +01:00
parent f0e1d123b2
commit a195bfd2b6

View File

@@ -717,17 +717,17 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
@Override @Override
public int getArtCount(String cardName, String setName) { public int getArtCount(String cardName, String setName) {
int cnt = 0;
if (cardName == null || setName == null) if (cardName == null || setName == null)
return cnt; return 0;
Collection<PaperCard> cards = getAllCards(cardName); Collection<PaperCard> cards = getAllCards(cardName);
if (null == cards || cards.size() == 0) if (null == cards || cards.size() == 0)
return 0; return 0;
int artCount = 0;
for (PaperCard pc : cards) { for (PaperCard pc : cards) {
if (pc.getEdition().equalsIgnoreCase(setName)) if (pc.getEdition().equalsIgnoreCase(setName))
cnt++; artCount++;
} }
return cnt; return artCount;
} }
// returns a list of all cards from their respective latest (or preferred) editions // returns a list of all cards from their respective latest (or preferred) editions