Skip to content

Drop redundant global search in Game.findByView else branch#10604

Merged
tool4ever merged 1 commit into
Card-Forge:masterfrom
MostCromulent:fix-findbyview-double-walk
May 5, 2026
Merged

Drop redundant global search in Game.findByView else branch#10604
tool4ever merged 1 commit into
Card-Forge:masterfrom
MostCromulent:fix-findbyview-double-walk

Conversation

@MostCromulent
Copy link
Copy Markdown
Contributor

Requested by Hanmac in #10343 (comment).

When a CardView has no controller or zone, the else branch in Game.findByView invokes forEachCardInGame, and the existing stale-zone-info fallback then invokes 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 stack and controller+zone paths reach the same result.


🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@MostCromulent MostCromulent requested review from Hanmac and tool4ever May 4, 2026 21:07
@tool4ever tool4ever merged commit 29aadf1 into Card-Forge:master May 5, 2026
2 checks passed
@MostCromulent MostCromulent deleted the fix-findbyview-double-walk branch May 5, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants