diff options
Diffstat (limited to 'fxbarcode/datamatrix/BC_HighLevelEncoder.cpp')
-rw-r--r-- | fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 56a8847066..f143ac29d0 100644 --- a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -127,27 +127,17 @@ WideString CBC_HighLevelEncoder::encodeHighLevel(WideString msg, } return codewords; } -int32_t CBC_HighLevelEncoder::lookAheadTest(WideString msg, +int32_t CBC_HighLevelEncoder::lookAheadTest(const WideString& msg, int32_t startpos, int32_t currentMode) { if (startpos >= pdfium::base::checked_cast<int32_t>(msg.GetLength())) { return currentMode; } - std::vector<float> charCounts; + std::vector<float> charCounts(6); if (currentMode == ASCII_ENCODATION) { - charCounts.push_back(0); - charCounts.push_back(1); - charCounts.push_back(1); - charCounts.push_back(1); - charCounts.push_back(1); - charCounts.push_back(1.25f); + charCounts = {0, 1, 1, 1, 1, 1.25f}; } else { - charCounts.push_back(1); - charCounts.push_back(2); - charCounts.push_back(2); - charCounts.push_back(2); - charCounts.push_back(2); - charCounts.push_back(2.25f); + charCounts = {1, 2, 2, 2, 2, 2.25f}; charCounts[currentMode] = 0; } int32_t charsProcessed = 0; |