mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
library replaced !contains -> put with putIfAbsent
This commit is contained in:
parent
246469ee48
commit
ab624c22ef
1 changed files with 1 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue