forked from External/mage
replaced various !contains -> put with putIfAbsent
This commit is contained in:
parent
ab624c22ef
commit
316137b5e2
5 changed files with 16 additions and 27 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue