From 99fc33f9dfe977b06953a4d62fd0475756d9e6b8 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 2 Sep 2014 13:53:52 +0200 Subject: [PATCH] ErasureCodeLrc.cc: prefer ++operator for non-primitive iterators Signed-off-by: Danny Al-Gaaf --- src/erasure-code/lrc/ErasureCodeLrc.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/erasure-code/lrc/ErasureCodeLrc.cc b/src/erasure-code/lrc/ErasureCodeLrc.cc index 249f9f7a5ac0e..2dd8fa9c12d16 100644 --- a/src/erasure-code/lrc/ErasureCodeLrc.cc +++ b/src/erasure-code/lrc/ErasureCodeLrc.cc @@ -129,7 +129,7 @@ int ErasureCodeLrc::layers_parse(string description_string, int position = 0; for (vector::iterator i = description.begin(); i != description.end(); - i++, position++) { + ++i, position++) { if (i->type() != json_spirit::array_type) { stringstream json_string; json_spirit::write(*i, json_string); @@ -417,7 +417,7 @@ int ErasureCodeLrc::parse_ruleset(const map ¶meters, int position = 0; for (vector::iterator i = description.begin(); i != description.end(); - i++, position++) { + ++i, position++) { if (i->type() != json_spirit::array_type) { stringstream json_string; json_spirit::write(*i, json_string); @@ -447,7 +447,7 @@ int ErasureCodeLrc::parse_ruleset_step(string description_string, int position = 0; for (vector::iterator i = description.begin(); i != description.end(); - i++, position++) { + ++i, position++) { if ((position == 0 || position == 1) && i->type() != json_spirit::str_type) { *ss << "element " << position << " of the array " @@ -628,7 +628,7 @@ int ErasureCodeLrc::minimum_to_decode(const set &want_to_read, // for (set::const_iterator j = erasures.begin(); j != erasures.end(); - j++) { + ++j) { erasures_not_recovered.erase(*j); if (erasures_want.count(*j)) erasures_want.erase(*j); @@ -641,7 +641,7 @@ int ErasureCodeLrc::minimum_to_decode(const set &want_to_read, minimum->insert(want_to_read.begin(), want_to_read.end()); for (set::const_iterator i = erasures_total.begin(); i != erasures_total.end(); - i++) { + ++i) { if (minimum->count(*i)) minimum->erase(*i); } @@ -688,7 +688,7 @@ int ErasureCodeLrc::minimum_to_decode(const set &want_to_read, // for (set::const_iterator j = layer_erasures.begin(); j != layer_erasures.end(); - j++) { + ++j) { erasures_total.erase(*j); } } @@ -730,7 +730,7 @@ int ErasureCodeLrc::encode_chunks(const set &want_to_encode, int j = 0; for (vector::const_iterator c = layer.chunks.begin(); c != layer.chunks.end(); - c++) { + ++c) { layer_encoded[j] = (*encoded)[*c]; if (want_to_encode.find(*c) != want_to_encode.end()) layer_want_to_encode.insert(j); @@ -783,7 +783,7 @@ int ErasureCodeLrc::decode_chunks(const set &want_to_read, int j = 0; for (vector::const_iterator c = layer->chunks.begin(); c != layer->chunks.end(); - c++) { + ++c) { // // Pick chunks from *decoded* instead of *chunks* to re-use // chunks recovered by previous layers. In other words @@ -809,7 +809,7 @@ int ErasureCodeLrc::decode_chunks(const set &want_to_read, j = 0; for (vector::const_iterator c = layer->chunks.begin(); c != layer->chunks.end(); - c++) { + ++c) { (*decoded)[*c] = layer_decoded[j]; ++j; if (erasures.count(*c) != 0) -- 2.39.5