From a999dca15f3a1184402bf57b9ce15047b80dbf1b Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Thu, 1 Jul 2021 04:35:23 +0000 Subject: [PATCH] Simplified an expression because C++11 natively supports for-each over a braced list, without needing to construct a typed object. --- cpp/QrCode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index b9de862..79890a5 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -279,7 +279,7 @@ QrCode QrCode::encodeSegments(const vector &segs, Ecc ecl, throw std::logic_error("Assertion error"); // Increase the error correction level while the data still fits in the current version number - for (Ecc newEcl : vector{Ecc::MEDIUM, Ecc::QUARTILE, Ecc::HIGH}) { // From low to high + for (Ecc newEcl : {Ecc::MEDIUM, Ecc::QUARTILE, Ecc::HIGH}) { // From low to high if (boostEcl && dataUsedBits <= getNumDataCodewords(version, newEcl) * 8) ecl = newEcl; }