Skip to content

Commit b24d72c

Browse files
Codex AgentBenWestgate
authored andcommitted
cli: Skip redundant share filtering
The preceding all-isinstance check rejects every non-share, so the list-comprehension predicate in recovery could never discard an item. Pass the validated list directly, using a type cast to express the established invariant to mypy. Recovery still copies and validates the sequence internally. Refs #46.
1 parent 95f009d commit b24d72c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/codex32/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _secret(artifacts: list[Artifact]) -> Secret:
102102
if not all(isinstance(artifact, Share) for artifact in artifacts):
103103
raise _UsageError("Recovery accepts ordinary shares or one complete secret.")
104104
try:
105-
return recover_secret([artifact for artifact in artifacts if isinstance(artifact, Share)])
105+
return recover_secret(cast(list[Share], artifacts))
106106
except CodexError as error:
107107
raise _UsageError(str(error)) from error
108108

0 commit comments

Comments
 (0)