diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index b9de862..fa5b8fd 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -156,7 +156,7 @@ QrSegment QrSegment::makeEci(long assignVal) { } -QrSegment::QrSegment(Mode md, int numCh, const std::vector &dt) : +QrSegment::QrSegment(const Mode &md, int numCh, const std::vector &dt) : mode(md), numChars(numCh), data(dt) { @@ -165,7 +165,7 @@ QrSegment::QrSegment(Mode md, int numCh, const std::vector &dt) : } -QrSegment::QrSegment(Mode md, int numCh, std::vector &&dt) : +QrSegment::QrSegment(const Mode &md, int numCh, std::vector &&dt) : mode(md), numChars(numCh), data(std::move(dt)) { diff --git a/cpp/QrCode.hpp b/cpp/QrCode.hpp index 7341e41..06d661a 100644 --- a/cpp/QrCode.hpp +++ b/cpp/QrCode.hpp @@ -170,7 +170,7 @@ class QrSegment final { * The character count (numCh) must agree with the mode and the bit buffer length, * but the constraint isn't checked. The given bit buffer is copied and stored. */ - public: QrSegment(Mode md, int numCh, const std::vector &dt); + public: QrSegment(const Mode &md, int numCh, const std::vector &dt); /* @@ -178,7 +178,7 @@ class QrSegment final { * The character count (numCh) must agree with the mode and the bit buffer length, * but the constraint isn't checked. The given bit buffer is moved and stored. */ - public: QrSegment(Mode md, int numCh, std::vector &&dt); + public: QrSegment(const Mode &md, int numCh, std::vector &&dt); /*---- Methods ----*/