summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-06-24 13:50:33 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-06-24 13:50:33 +0200
commit4ab5bf6ff30ebf3c0a878fabde6f2e852f76ce84 (patch)
tree02573447643ac775bd0be991671c07c2415a7233
parent134d08a9654f66634b893d493e4a92f38acc63cf (diff)
downloadceph-4ab5bf6ff30ebf3c0a878fabde6f2e852f76ce84.tar.gz
common/cmdparse.cc: prefer prefix ++operator for non-trivial iterator
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/common/cmdparse.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/cmdparse.cc b/src/common/cmdparse.cc
index d4984d1d332..5cb51223347 100644
--- a/src/common/cmdparse.cc
+++ b/src/common/cmdparse.cc
@@ -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());