From: Matan Breizman Date: Sun, 25 Dec 2022 10:37:24 +0000 (+0000) Subject: osd/ReplicatedBackend: dump_recovery_info() use ranged-based for in X-Git-Tag: v19.0.0~1594^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c199bb53a3138ede8582f5829214ccd52d4aece0;p=ceph.git osd/ReplicatedBackend: dump_recovery_info() use ranged-based for in Signed-off-by: Matan Breizman --- diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index 6f61aef37243..7e18c5e829d7 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -91,19 +91,15 @@ public: void dump_recovery_info(ceph::Formatter *f) const override { { f->open_array_section("pull_from_peer"); - for (std::map >::const_iterator i = pull_from_peer.begin(); - i != pull_from_peer.end(); - ++i) { + for (const auto& i : pull_from_peer) { f->open_object_section("pulling_from"); - f->dump_stream("pull_from") << i->first; + f->dump_stream("pull_from") << i.first; { f->open_array_section("pulls"); - for (std::set::const_iterator j = i->second.begin(); - j != i->second.end(); - ++j) { + for (const auto& j : i.second) { f->open_object_section("pull_info"); - ceph_assert(pulling.count(*j)); - pulling.find(*j)->second.dump(f); + ceph_assert(pulling.count(j)); + pulling.find(j)->second.dump(f); f->close_section(); } f->close_section(); @@ -114,22 +110,17 @@ public: } { f->open_array_section("pushing"); - for (std::map>::const_iterator i = - pushing.begin(); - i != pushing.end(); - ++i) { + for(const auto& i : pushing) { f->open_object_section("object"); - f->dump_stream("pushing") << i->first; + f->dump_stream("pushing") << i.first; { f->open_array_section("pushing_to"); - for (std::map::const_iterator j = i->second.begin(); - j != i->second.end(); - ++j) { + for (const auto& j : i.second) { f->open_object_section("push_progress"); - f->dump_stream("pushing_to") << j->first; + f->dump_stream("pushing_to") << j.first; { f->open_object_section("push_info"); - j->second.dump(f); + j.second.dump(f); f->close_section(); } f->close_section();