]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: refactor PrimaryLogPG::earliest_backfill().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 27 Feb 2020 15:07:50 +0000 (16:07 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 27 Feb 2020 15:37:27 +0000 (16:37 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/osd/PrimaryLogPG.cc

index eeb5a69e0d882fdfaf3d8ece6ba0deafd106e0f3..21244c62de1a33b2b44d9cb58360285e2f8db4f2 100644 (file)
@@ -1799,13 +1799,9 @@ void PrimaryLogPG::do_request(
 hobject_t PrimaryLogPG::earliest_backfill() const
 {
   hobject_t e = hobject_t::get_max();
-  for (set<pg_shard_t>::const_iterator i = get_backfill_targets().begin();
-       i != get_backfill_targets().end();
-       ++i) {
-    pg_shard_t bt = *i;
+  for (const pg_shard_t& bt : get_backfill_targets()) {
     const pg_info_t &pi = recovery_state.get_peer_info(bt);
-    if (pi.last_backfill < e)
-      e = pi.last_backfill;
+    e = std::min(pi.last_backfill, e);
   }
   return e;
 }