mon/OSDMonitor: cleanup: use range-based loop

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-04-19 10:16:40 -04:00
parent 069182f91f
commit 1cb4da85e9

View 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 {