From: Michal Jarzabek Date: Mon, 31 Oct 2016 22:22:55 +0000 (+0000) Subject: mds/Mantle: pass parameters by const ref X-Git-Tag: v11.1.0~392^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb5a055dbbfb27cc62dec9baa882805b1a0e6c99;p=ceph.git mds/Mantle: pass parameters by const ref Signed-off-by: Michal Jarzabek --- diff --git a/src/mds/Mantle.cc b/src/mds/Mantle.cc index eb4fff5520a7..e9a65ef1a0cb 100644 --- a/src/mds/Mantle.cc +++ b/src/mds/Mantle.cc @@ -67,7 +67,7 @@ int Mantle::start() return 0; } -int Mantle::execute(string script) +int Mantle::execute(const string &script) { if (L == NULL) { dout(0) << "ERROR: mantle was not started" << dendl; @@ -93,9 +93,9 @@ int Mantle::execute(string script) return 0; } -int Mantle::balance(string script, +int Mantle::balance(const string &script, mds_rank_t whoami, - vector < map > metrics, + const vector < map > &metrics, map &my_targets) { if (start() != 0) @@ -114,7 +114,7 @@ int Mantle::balance(string script, lua_newtable(L); /* push values into this mds's table; setfield assigns key/pops val */ - for (map::iterator it = metrics[i].begin(); + for (map::const_iterator it = metrics[i].begin(); it != metrics[i].end(); it++) { lua_pushnumber(L, it->second); diff --git a/src/mds/Mantle.h b/src/mds/Mantle.h index 7aee990b6a12..e3348a64f96a 100644 --- a/src/mds/Mantle.h +++ b/src/mds/Mantle.h @@ -31,10 +31,10 @@ class Mantle { public: Mantle() : L(NULL) {}; int start(); - int execute(string script); - int balance(string script, + int execute(const string &script); + int balance(const string &script, mds_rank_t whoami, - vector < map > metrics, + const vector < map > &metrics, map &my_targets); };