diff options
Diffstat (limited to 'fxbarcode/datamatrix')
-rw-r--r-- | fxbarcode/datamatrix/BC_Base256Encoder.cpp | 5 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/fxbarcode/datamatrix/BC_Base256Encoder.cpp index 1b8db85bdd..dd49c8e0f5 100644 --- a/fxbarcode/datamatrix/BC_Base256Encoder.cpp +++ b/fxbarcode/datamatrix/BC_Base256Encoder.cpp @@ -70,9 +70,8 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { return; } } - for (int32_t i = 0, c = buffer.GetLength(); i < c; i++) { - context.writeCodeword( - randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1)); + for (const auto& c : buffer) { + context.writeCodeword(randomize255State(c, context.getCodewordCount() + 1)); } } wchar_t CBC_Base256Encoder::randomize255State(wchar_t ch, diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 041272ef8c..cce9749749 100644 --- a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -63,8 +63,7 @@ std::vector<uint8_t>& CBC_HighLevelEncoder::getBytesForMessage( CFX_WideString msg) { CFX_ByteString bytestr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr); - for (int32_t i = 0; i < bytestr.GetLength(); i++) - m_bytearray.push_back(bytestr.GetAt(i)); + m_bytearray.insert(m_bytearray.end(), bytestr.begin(), bytestr.end()); return m_bytearray; } CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, |