]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use list::remove_if() if possible 17753/head
authorKefu Chai <kchai@redhat.com>
Fri, 15 Sep 2017 11:24:17 +0000 (19:24 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Sep 2017 11:27:15 +0000 (19:27 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/OSD.h

index 2982656fdd349b843d5b9660b0731ec30bbb59ee..5c26b7cb0281099396f6cf8972769d7d886543c8 100644 (file)
@@ -935,16 +935,10 @@ public:
   }
   void clear_queued_recovery(PG *pg) {
     Mutex::Locker l(recovery_lock);
-    for (list<pair<epoch_t, PGRef> >::iterator i = awaiting_throttle.begin();
-        i != awaiting_throttle.end();
-      ) {
-      if (i->second.get() == pg) {
-       awaiting_throttle.erase(i);
-       return;
-      } else {
-       ++i;
-      }
-    }
+    awaiting_throttle.remove_if(
+      [pg](decltype(awaiting_throttle)::const_reference awaiting ) {
+       return awaiting.second.get() == pg;
+      });
   }
   // delayed pg activation
   void queue_for_recovery(PG *pg) {