]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MonClient: pass function parameter by reference
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 19 Feb 2014 13:54:02 +0000 (14:54 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 19 Feb 2014 13:54:02 +0000 (14:54 +0100)
[src/mon/MonClient.h:412]: (performance) Function parameter 'mon_name'
  should be passed by reference.

Changed also parameter name in function implementation to match name
in declaration.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/MonClient.cc
src/mon/MonClient.h

index 3ddd21fcecb0737a7c89fe20602464de87446aa5..25dd3cdfe367879be51f620c8b6492035af984fc 100644 (file)
@@ -962,7 +962,7 @@ int MonClient::start_mon_command(const vector<string>& cmd,
   return 0;
 }
 
-int MonClient::start_mon_command(string name,
+int MonClient::start_mon_command(const string &mon_name,
                                 const vector<string>& cmd,
                                 const bufferlist& inbl,
                                 bufferlist *outbl, string *outs,
@@ -970,7 +970,7 @@ int MonClient::start_mon_command(string name,
 {
   Mutex::Locker l(monc_lock);
   MonCommand *r = new MonCommand(++last_mon_command_tid);
-  r->target_name = name;
+  r->target_name = mon_name;
   r->cmd = cmd;
   r->inbl = inbl;
   r->poutbl = outbl;
index 5d2bf81d9d38a26d2b51f6cae49379797149c051..a2998bb60c7a94a1f64b63c454bf88b7ec3d561f 100644 (file)
@@ -409,7 +409,7 @@ public:
                        const vector<string>& cmd, const bufferlist& inbl,
                        bufferlist *outbl, string *outs,
                        Context *onfinish);
-  int start_mon_command(const string mon_name,  ///< mon name, with mon. prefix
+  int start_mon_command(const string &mon_name,  ///< mon name, with mon. prefix
                        const vector<string>& cmd, const bufferlist& inbl,
                        bufferlist *outbl, string *outs,
                        Context *onfinish);