From bbb77459f0c80dffca80fcaed0e3fc05bbc98ecb Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Sat, 13 Aug 2016 21:58:59 +0100 Subject: [PATCH] mon/MonCap.h: add std::move for std::string Signed-off-by: Michal Jarzabek --- src/mon/MonCap.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mon/MonCap.h b/src/mon/MonCap.h index 2501f442af6..3bdd5479838 100644 --- a/src/mon/MonCap.h +++ b/src/mon/MonCap.h @@ -39,7 +39,8 @@ struct StringConstraint { string prefix; StringConstraint() {} - StringConstraint(string a, string b) : value(a), prefix(b) {} + StringConstraint(string a, string b) + : value(std::move(a)), prefix(std::move(b)) {} }; ostream& operator<<(ostream& out, const StringConstraint& c); @@ -82,10 +83,10 @@ struct MonCapGrant { MonCapGrant() : allow(0) {} // cppcheck-suppress noExplicitConstructor MonCapGrant(mon_rwxa_t a) : allow(a) {} - MonCapGrant(string s, mon_rwxa_t a) : service(s), allow(a) {} + MonCapGrant(string s, mon_rwxa_t a) : service(std::move(s)), allow(a) {} // cppcheck-suppress noExplicitConstructor - MonCapGrant(string c) : command(c) {} - MonCapGrant(string c, string a, StringConstraint co) : command(c) { + MonCapGrant(string c) : command(std::move(c)) {} + MonCapGrant(string c, string a, StringConstraint co) : command(std::move(c)) { command_args[a] = co; }