]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedBackend: dump_recovery_info() use ranged-based for in
authorMatan Breizman <mbreizma@redhat.com>
Sun, 25 Dec 2022 10:37:24 +0000 (10:37 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 25 Dec 2022 11:17:26 +0000 (11:17 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/osd/ReplicatedBackend.h

index 6f61aef37243f18c920d2fd632d97b05c29bf928..7e18c5e829d71fda1908cba94f05a5a10c31c5b5 100644 (file)
@@ -91,19 +91,15 @@ public:
   void dump_recovery_info(ceph::Formatter *f) const override {
     {
       f->open_array_section("pull_from_peer");
-      for (std::map<pg_shard_t, std::set<hobject_t> >::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<hobject_t>::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<hobject_t, std::map<pg_shard_t, PushInfo>>::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<pg_shard_t, PushInfo>::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();