]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: cleanup: use range-based loop 14559/head
authorSage Weil <sage@redhat.com>
Wed, 19 Apr 2017 14:16:40 +0000 (10:16 -0400)
committerSage Weil <sage@redhat.com>
Fri, 21 Apr 2017 14:56:28 +0000 (10:56 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index e36ecae30d69cbb0c8bca36bedc0e89f7485097a..05893c41a0c0184672e66e6ebc0614f899c1649d 100644 (file)
@@ -3846,17 +3846,16 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
       f->dump_unsigned("epoch", osdmap.get_epoch());
       f->dump_stream("raw_pgid") << pgid;
       f->dump_stream("pgid") << mpgid;
-
       f->open_array_section("up");
-      for (vector<int>::iterator it = up.begin(); it != up.end(); ++it)
-       f->dump_int("up_osd", *it);
+      for (auto osd : up) {
+       f->dump_int("up_osd", osd);
+      }
       f->close_section();
-
       f->open_array_section("acting");
-      for (vector<int>::iterator it = acting.begin(); it != acting.end(); ++it)
-       f->dump_int("acting_osd", *it);
+      for (auto osd : acting) {
+       f->dump_int("acting_osd", osd);
+      }
       f->close_section();
-
       f->close_section();
       f->flush(rdata);
     } else {