From 1cb4da85e9fb9ff4758f31ef02952c1d64d91d0e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 19 Apr 2017 10:16:40 -0400 Subject: [PATCH] mon/OSDMonitor: cleanup: use range-based loop Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e36ecae30d6..05893c41a0c 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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::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::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 {