Simplified C++ code with vector range constructor.

This commit is contained in:
Project Nayuki
2017-08-31 20:25:39 +00:00
parent fca2a8a27c
commit 6f9116dfcb
2 changed files with 3 additions and 6 deletions
+1 -3
View File
@@ -75,9 +75,7 @@ int main() {
// Make list of segments
std::vector<QrSegment> segs;
if (isAscii) {
std::vector<char> text;
for (std::vector<uint8_t>::iterator it = data.begin(); it != data.end(); ++it)
text.push_back((char)*it);
std::vector<char> text(data.cbegin(), data.cend());
text.push_back('\0');
segs = QrSegment::makeSegments(text.data());
} else