From 236a9996370c3acfe39cd74a79bfb7f75f5eb989 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Wed, 6 Sep 2017 04:06:57 +0000 Subject: [PATCH] Tweaked usages of C++ QrSegment::Mode class to be passed by value instead of const reference. --- cpp/QrSegment.cpp | 4 ++-- cpp/QrSegment.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/QrSegment.cpp b/cpp/QrSegment.cpp index 202e6c9..f711461 100644 --- a/cpp/QrSegment.cpp +++ b/cpp/QrSegment.cpp @@ -151,7 +151,7 @@ QrSegment QrSegment::makeEci(long assignVal) { } -QrSegment::QrSegment(const Mode &md, int numCh, const std::vector &dt) : +QrSegment::QrSegment(Mode md, int numCh, const std::vector &dt) : mode(md), numChars(numCh), data(dt) { @@ -160,7 +160,7 @@ QrSegment::QrSegment(const Mode &md, int numCh, const std::vector &dt) : } -QrSegment::QrSegment(const Mode &md, int numCh, std::vector &&dt) : +QrSegment::QrSegment(Mode md, int numCh, std::vector &&dt) : mode(md), numChars(numCh), data(std::move(dt)) { diff --git a/cpp/QrSegment.hpp b/cpp/QrSegment.hpp index a19c53f..779f063 100644 --- a/cpp/QrSegment.hpp +++ b/cpp/QrSegment.hpp @@ -152,13 +152,13 @@ class QrSegment final { /* * Creates a new QR Code data segment with the given parameters and data. */ - public: QrSegment(const Mode &md, int numCh, const std::vector &dt); + public: QrSegment(Mode md, int numCh, const std::vector &dt); /* * Creates a new QR Code data segment with the given parameters and data. */ - public: QrSegment(const Mode &md, int numCh, std::vector &&dt); + public: QrSegment(Mode md, int numCh, std::vector &&dt); /*---- Methods ----*/