From a6c69988d95e4b3c0192b664eb921522b11c645a Mon Sep 17 00:00:00 2001 From: MostCromulent <201167372+MostCromulent@users.noreply.github.com> Date: Tue, 5 May 2026 06:34:15 +0930 Subject: [PATCH] Drop redundant global search in Game.findByView else branch When a CardView has no controller or zone, the else branch invoked forEachCardInGame and the subsequent stale-zone-info fallback then invoked it again on the same visitor. Removing the else branch lets the fallback handle that case in a single global walk. Behaviour is otherwise identical: CardIdVisitor.getFound() is idempotent, so the other paths reach the same result. Co-Authored-By: Claude Opus 4.7 (1M context) --- forge-game/src/main/java/forge/game/Game.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/Game.java b/forge-game/src/main/java/forge/game/Game.java index b8095c8fecd..efab401282c 100644 --- a/forge-game/src/main/java/forge/game/Game.java +++ b/forge-game/src/main/java/forge/game/Game.java @@ -702,8 +702,6 @@ public Card findByView(CardView view) { if (p != null) { visit.visitAll(p.getZone(view.getZone())); } - } else { - forEachCardInGame(visit); } // Zone-specific search may miss if the view has stale zone info // (e.g. IdRef resolved from a tracker that wasn't updated after a