mirror of
https://gitee.com/openharmony/third_party_qrcodegen
synced 2025-02-19 08:40:29 +00:00
Tweaked a bit of C++ code to use strict bounds checking for consistency.
This commit is contained in:
parent
68b2b7782b
commit
772a311c56
@ -310,7 +310,7 @@ QrCode QrCode::encodeSegments(const vector<QrSegment> &segs, Ecc ecl,
|
||||
// Pack bits into bytes in big endian
|
||||
vector<uint8_t> dataCodewords(bb.size() / 8);
|
||||
for (size_t i = 0; i < bb.size(); i++)
|
||||
dataCodewords[i >> 3] |= (bb.at(i) ? 1 : 0) << (7 - (i & 7));
|
||||
dataCodewords.at(i >> 3) |= (bb.at(i) ? 1 : 0) << (7 - (i & 7));
|
||||
|
||||
// Create the QR Code object
|
||||
return QrCode(version, ecl, dataCodewords, mask);
|
||||
|
Loading…
x
Reference in New Issue
Block a user