]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: simplify loop
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 16 Nov 2023 17:07:32 +0000 (12:07 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 22 Mar 2024 15:38:01 +0000 (11:38 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit cdef9b6dd0a4d0fe39843c5a8198295d14b1c2e7)

src/common/TrackedOp.cc

index 32a1ab472a89f82096454b2ed672e173963a971c..0de21e38743ac2b22ddb753bdc11ab499c6bcf86 100644 (file)
@@ -207,14 +207,11 @@ void OpHistory::dump_slow_ops(utime_t now, Formatter *f, set<string> filters)
   f->dump_int("threshold to keep", history_slow_op_threshold.load());
   {
     f->open_array_section("Ops");
-    for (set<pair<utime_t, TrackedOpRef> >::const_iterator i =
-          slow_op.begin();
-        i != slow_op.end();
-        ++i) {
-      if (!i->second->filter_out(filters))
+    for (const auto& [t, op] : slow_op) {
+      if (!op->filter_out(filters))
         continue;
       f->open_object_section("Op");
-      i->second->dump(now, f, OpTracker::default_dumper);
+      op->dump(now, f, OpTracker::default_dumper);
       f->close_section();
     }
     f->close_section();