Skip to content

Commit

Permalink
Address review comment: use ValueOr
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed May 2, 2024
1 parent a383e39 commit 0dcae2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/setup_payload/QRCodeSetupPayloadGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ static CHIP_ERROR generateBitSet(PayloadContents & payload, MutableByteSpan & bi
populateBits(bits.data(), offset, payload.productID, kProductIDFieldLengthInBits, kTotalPayloadDataSizeInBits));
ReturnErrorOnFailure(populateBits(bits.data(), offset, static_cast<uint64_t>(payload.commissioningFlow),
kCommissioningFlowFieldLengthInBits, kTotalPayloadDataSizeInBits));
auto const & ri = payload.rendezvousInformation;
ReturnErrorOnFailure(populateBits(bits.data(), offset, (ri.HasValue() ? ri.Value().Raw() : 0), kRendezvousInfoFieldLengthInBits,
kTotalPayloadDataSizeInBits));
ReturnErrorOnFailure(populateBits(bits.data(), offset,
payload.rendezvousInformation.ValueOr(RendezvousInformationFlag::kNone).Raw(),
kRendezvousInfoFieldLengthInBits, kTotalPayloadDataSizeInBits));
auto const & pd = payload.discriminator;
ReturnErrorOnFailure(populateBits(bits.data(), offset, (!pd.IsShortDiscriminator() ? pd.GetLongValue() : 0),
kPayloadDiscriminatorFieldLengthInBits, kTotalPayloadDataSizeInBits));
Expand Down

0 comments on commit 0dcae2f

Please sign in to comment.