Performance fix to get out of the loop quicker if library is empty
@@ -71,7 +71,9 @@ class ClearTheLandEffect extends OneShotEffect {
Library library = player.getLibrary();
Cards cardsToReveal = new CardsImpl();
for (int i = 0; i < numOfCardsToReveal; i++) {
- if (library.hasCards()) {
+ if (!library.hasCards()) {
+ break;
+ }
Card card = library.getFromTop(game);
cardsToReveal.add(card);
if (card.isLand()) {
@@ -80,7 +82,6 @@ class ClearTheLandEffect extends OneShotEffect {
player.moveCards(card, Zone.EXILED, source, game);
}
}
- }
player.revealCards(source, "Revealed cards for " + player.getName(), cardsToReveal, game);
}
}
