diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index f831ef2..b62afe3 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -50,7 +50,7 @@ int QrCode::getFormatBits(Ecc ecl) { QrCode QrCode::encodeText(const char *text, Ecc ecl) { - vector segs(QrSegment::makeSegments(text)); + vector segs = QrSegment::makeSegments(text); return encodeSegments(segs, ecl); } @@ -123,7 +123,7 @@ QrCode::QrCode(int ver, Ecc ecl, const vector &dataCodewords, int mask) // Draw function patterns, draw all codewords, do masking drawFunctionPatterns(); - const vector allCodewords(appendErrorCorrection(dataCodewords)); + const vector allCodewords = appendErrorCorrection(dataCodewords); drawCodewords(allCodewords); this->mask = handleConstructorMasking(mask); } @@ -195,7 +195,7 @@ void QrCode::drawFunctionPatterns() { drawFinderPattern(3, size - 4); // Draw numerous alignment patterns - const vector alignPatPos(getAlignmentPatternPositions(version)); + const vector alignPatPos = getAlignmentPatternPositions(version); int numAlign = alignPatPos.size(); for (int i = 0; i < numAlign; i++) { for (int j = 0; j < numAlign; j++) { @@ -311,7 +311,7 @@ vector QrCode::appendErrorCorrection(const vector &data) const for (int i = 0, k = 0; i < numBlocks; i++) { vector dat(data.cbegin() + k, data.cbegin() + (k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1))); k += dat.size(); - const vector ecc(rs.getRemainder(dat)); + const vector ecc = rs.getRemainder(dat); if (i < numShortBlocks) dat.push_back(0); dat.insert(dat.end(), ecc.cbegin(), ecc.cend());