From: Danny Al-Gaaf Date: Wed, 13 Mar 2013 17:40:44 +0000 (+0100) Subject: src/crush/CrushTester.{cc,h}: prefer prefix ++operator for iterators X-Git-Tag: v0.60~79^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4056552c90d7a5f37648b2e776b68b1b73122e37;p=ceph.git src/crush/CrushTester.{cc,h}: prefer prefix ++operator for iterators Signed-off-by: Danny Al-Gaaf --- diff --git a/src/crush/CrushTester.cc b/src/crush/CrushTester.cc index a659787e4f1b..0a649d8c77c0 100644 --- a/src/crush/CrushTester.cc +++ b/src/crush/CrushTester.cc @@ -44,7 +44,7 @@ int CrushTester::get_maximum_affected_by_rule(int ruleno) // loop through the vector of affected types for (vector::iterator it = affected_types.begin(); it != affected_types.end(); ++it){ // loop through the number of buckets looking for affected types - for (map::iterator p = crush.name_map.begin(); p != crush.name_map.end(); p++){ + for (map::iterator p = crush.name_map.begin(); p != crush.name_map.end(); ++p){ int bucket_type = crush.get_bucket_type(p->first); if ( bucket_type == *it) max_devices_of_type[*it]++; @@ -152,7 +152,7 @@ bool CrushTester::check_valid_placement(int ruleno, vector in, const vector map seen_devices; // first do the easy check that all devices are "up" - for (vector::iterator it = in.begin(); it != in.end(); it++) { + for (vector::iterator it = in.begin(); it != in.end(); ++it) { if (weight[(*it)] == 0) { valid_placement = false; break; @@ -173,7 +173,7 @@ bool CrushTester::check_valid_placement(int ruleno, vector in, const vector // get the smallest type id, and name int min_map_type = crush.get_num_type_names(); - for (map::iterator it = crush.type_map.begin(); it != crush.type_map.end(); it++ ) { + for (map::iterator it = crush.type_map.begin(); it != crush.type_map.end(); ++it ) { if ( (*it).first < min_map_type ) { min_map_type = (*it).first; } @@ -202,7 +202,7 @@ bool CrushTester::check_valid_placement(int ruleno, vector in, const vector } // check that we don't have any duplicate id's - for (vector::iterator it = included_devices.begin(); it != included_devices.end(); it++) { + for (vector::iterator it = included_devices.begin(); it != included_devices.end(); ++it) { int num_copies = count(included_devices.begin(), included_devices.end(), (*it) ); if (num_copies > 1) { valid_placement = false; @@ -212,7 +212,7 @@ bool CrushTester::check_valid_placement(int ruleno, vector in, const vector // if we have more than just osd's affected we need to do a lot more work if (!only_osd_affected) { // loop through the devices that are "in/up" - for (vector::iterator it = included_devices.begin(); it != included_devices.end(); it++) { + for (vector::iterator it = included_devices.begin(); it != included_devices.end(); ++it) { if (valid_placement == false) break; @@ -220,7 +220,7 @@ bool CrushTester::check_valid_placement(int ruleno, vector in, const vector map device_location_hierarchy = crush.get_full_location(*it); // loop over the types affected by RULENO looking for duplicate bucket assignments - for (vector::iterator t = affected_types.begin(); t != affected_types.end(); t++) { + for (vector::iterator t = affected_types.begin(); t != affected_types.end(); ++t) { if (seen_devices.count( device_location_hierarchy[*t])) { valid_placement = false; break; @@ -523,7 +523,7 @@ int CrushTester::test() err << " device " << i << ":\t" << per[i] << std::endl; - for (map::iterator p = sizes.begin(); p != sizes.end(); p++) + for (map::iterator p = sizes.begin(); p != sizes.end(); ++p) if (output_statistics) err << "rule " << r << " (" << crush.get_rule_name(r) << ") num_rep " << nr << " result size == " << p->first << ":\t" diff --git a/src/crush/CrushTester.h b/src/crush/CrushTester.h index 4a23fd614e23..0cbab0fd9880 100644 --- a/src/crush/CrushTester.h +++ b/src/crush/CrushTester.h @@ -89,14 +89,14 @@ class CrushTester { void write_to_csv(ofstream& csv_file, vector& payload) { if (csv_file.good()) - for (vector::iterator it = payload.begin(); it != payload.end(); it++) + for (vector::iterator it = payload.begin(); it != payload.end(); ++it) csv_file << (*it); } void write_to_csv(ofstream& csv_file, map& payload) { if (csv_file.good()) - for (map::iterator it = payload.begin(); it != payload.end(); it++) + for (map::iterator it = payload.begin(); it != payload.end(); ++it) csv_file << (*it).first << ',' << (*it).second << std::endl; }