replaced various !contains -> put with putIfAbsent

This commit is contained in:
igoudt 2017-01-09 13:07:32 +01:00
parent ab624c22ef
commit 316137b5e2
5 changed files with 16 additions and 27 deletions

View file

@ -230,9 +230,7 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
Map<String, Card> cards = new HashMap<>();
for (UUID cardId : this) {
Card card = game.getCard(cardId);
if (!cards.containsKey(card.getName())) {
cards.put(card.getName(), card);
}
cards.putIfAbsent(card.getName(), card);
}
return cards.values();
}