From: Junghoon Park Date: Mon, 1 Jul 2019 01:55:03 +0000 (+0900) Subject: Change const string& to string X-Git-Tag: accepted/tizen/unified/20190702.115009~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9ff42fddcbfd7a5d419c776c15c44ece42c1f48;p=platform%2Fcore%2Fappfw%2Frpc-port.git Change const string& to string - It is better to moving value type in case of adding elements to internal container Change-Id: I31faa20c4fc49b8342183efba8c5809365c8d18b Signed-off-by: Junghoon Park --- diff --git a/src/ac-internal.cc b/src/ac-internal.cc index 89138ca..a8c0f85 100644 --- a/src/ac-internal.cc +++ b/src/ac-internal.cc @@ -37,8 +37,8 @@ namespace internal { AccessController::~AccessController() {} -void AccessController::AddPrivilege(const std::string& privilege) { - privileges_.push_back(privilege); +void AccessController::AddPrivilege(std::string privilege) { + privileges_.push_back(std::move(privilege)); } void AccessController::SetTrusted(const bool trusted) { diff --git a/src/ac-internal.h b/src/ac-internal.h index d11d33b..88bc8be 100644 --- a/src/ac-internal.h +++ b/src/ac-internal.h @@ -34,7 +34,7 @@ class AccessController { explicit AccessController(bool trusted = false) : trusted_(trusted) {} virtual ~AccessController(); - void AddPrivilege(const std::string& privilege); + void AddPrivilege(std::string privilege); void SetTrusted(const bool trusted); int Check(GDBusConnection *connection, const char *sender, const char* sender_appid);