Signed-off-by: Kefu Chai <kchai@redhat.com>
* false, ss is valid */
bool
-cmdmap_from_json(vector<string> cmd, cmdmap_t *mapp, stringstream &ss)
+cmdmap_from_json(const vector<string>& cmd, cmdmap_t *mapp, stringstream &ss)
{
json_spirit::mValue v;
string fullcmd;
// First, join all cmd strings
- for (vector<string>::iterator it = cmd.begin();
- it != cmd.end(); ++it)
- fullcmd += *it;
+ for (auto& c : cmd)
+ fullcmd += c;
try {
if (!json_spirit::read(fullcmd, v))
const std::string& module,
const std::string& perm,
uint64_t flags);
-bool cmdmap_from_json(std::vector<std::string> cmd, cmdmap_t *mapp,
+bool cmdmap_from_json(const std::vector<std::string>& cmd, cmdmap_t *mapp,
std::stringstream &ss);
void cmdmap_dump(const cmdmap_t &cmdmap, ceph::Formatter *f);
void handle_bad_get(CephContext *cct, const std::string& k, const char *name);