Change const string& to string 35/208835/1
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 1 Jul 2019 01:55:03 +0000 (10:55 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 1 Jul 2019 01:55:42 +0000 (10:55 +0900)
- It is better to moving value type in case of adding elements to internal container

Change-Id: I31faa20c4fc49b8342183efba8c5809365c8d18b
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
src/ac-internal.cc
src/ac-internal.h

index 89138ca..a8c0f85 100644 (file)
@@ -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) {
index d11d33b..88bc8be 100644 (file)
@@ -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);