Skip to content

Commit

Permalink
fix: remove double if
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed Sep 27, 2023
1 parent dcf057c commit 206cb66
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/signTxCVoteRegistration.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,9 @@ static void signTxCVoteRegistration_handleVotingPurposeAPDU(const uint8_t* wireD
VALIDATE(subctx->format == CIP36, ERR_INVALID_DATA);
}

if (isVotingPurposeIncluded) {
subctx->stateData.votingPurpose = parse_u8be(&view);
} else {
subctx->stateData.votingPurpose = DEFAULT_VOTING_PURPOSE;
}
subctx->stateData.votingPurpose = (isVotingPurposeIncluded) ?
parse_u8be(&view) :
DEFAULT_VOTING_PURPOSE;
TRACE("votingPurpose = %u", subctx->stateData.votingPurpose);

VALIDATE(view_remainingSize(&view) == 0, ERR_INVALID_DATA);
Expand Down

0 comments on commit 206cb66

Please sign in to comment.