mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
common/cmdparse.cc: prefer prefix ++operator for non-trivial iterator
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
134d08a965
commit
4ab5bf6ff3
@ -70,7 +70,7 @@ dump_cmd_to_json(JSONFormatter *f, const string& cmd)
|
||||
f->open_object_section(desckv["name"].c_str());
|
||||
// dump all the keys including name into the array
|
||||
for (std::map<std::string, std::string>::iterator it = desckv.begin();
|
||||
it != desckv.end(); it++) {
|
||||
it != desckv.end(); ++it) {
|
||||
f->dump_string(it->first.c_str(), it->second);
|
||||
}
|
||||
f->close_section(); // attribute object for individual desc
|
||||
@ -106,7 +106,7 @@ cmdmap_from_json(vector<string> cmd, map<string, cmd_vartype> *mapp, stringstrea
|
||||
string fullcmd;
|
||||
// First, join all cmd strings
|
||||
for (vector<string>::iterator it = cmd.begin();
|
||||
it != cmd.end(); it++)
|
||||
it != cmd.end(); ++it)
|
||||
fullcmd += *it;
|
||||
|
||||
try {
|
||||
@ -119,7 +119,7 @@ cmdmap_from_json(vector<string> cmd, map<string, cmd_vartype> *mapp, stringstrea
|
||||
// make sure all contents are simple types (not arrays or objects)
|
||||
json_spirit::mObject o = v.get_obj();
|
||||
for (map<string, json_spirit::mValue>::iterator it = o.begin();
|
||||
it != o.end(); it++) {
|
||||
it != o.end(); ++it) {
|
||||
|
||||
// ok, marshal it into our string->cmd_vartype map, or throw an
|
||||
// exception if it's not a simple datatype. This is kind of
|
||||
@ -140,7 +140,7 @@ cmdmap_from_json(vector<string> cmd, map<string, cmd_vartype> *mapp, stringstrea
|
||||
vector<json_spirit::mValue> spvals = it->second.get_array();
|
||||
vector<string> outv;
|
||||
for (vector<json_spirit::mValue>::iterator sv = spvals.begin();
|
||||
sv != spvals.end(); sv++) {
|
||||
sv != spvals.end(); ++sv) {
|
||||
if (sv->type() != json_spirit::str_type)
|
||||
throw(runtime_error("Can't handle arrays of non-strings"));
|
||||
outv.push_back(sv->get_str());
|
||||
|
Loading…
Reference in New Issue
Block a user