library replaced !contains -> put with putIfAbsent

This commit is contained in:
igoudt 2017-01-09 12:09:03 +01:00
parent 246469ee48
commit ab624c22ef

View file

@ -208,9 +208,7 @@ public class Library implements Serializable {
Map<String, Card> cards = new HashMap<>();
for (UUID cardId : library) {
Card card = game.getCard(cardId);
if (!cards.containsKey(card.getName())) {
cards.put(card.getName(), card);
}
cards.putIfAbsent(card.getName(), card);
}
return cards.values();
}