From 206cb6691c05883d243e8d977b0e9edd06d72156 Mon Sep 17 00:00:00 2001 From: Jan Mazak Date: Mon, 25 Sep 2023 16:46:16 +0200 Subject: [PATCH] fix: remove double if --- src/signTxCVoteRegistration.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/signTxCVoteRegistration.c b/src/signTxCVoteRegistration.c index 63d288b9..cb06ffb5 100644 --- a/src/signTxCVoteRegistration.c +++ b/src/signTxCVoteRegistration.c @@ -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);