]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimryLogPG: avoid repetitive lookups on waiting_for_ondisk in eval_repop.
authorIgor Fedotov <ifedotov@suse.com>
Thu, 23 Nov 2017 11:21:48 +0000 (14:21 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 3 Jan 2018 13:18:15 +0000 (16:18 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/osd/PrimaryLogPG.cc

index 4c2a265b474ac5cc58934def0771f90082210714..6ec09184ec6dcea374caa392397df6971c10f337 100644 (file)
@@ -9789,16 +9789,17 @@ void PrimaryLogPG::eval_repop(RepGather *repop)
       (*p)();
     }
     // send dup commits, in order
-    if (waiting_for_ondisk.count(repop->v)) {
+    auto it = waiting_for_ondisk.find(repop->v);
+    if (it != waiting_for_ondisk.end()) {
       assert(waiting_for_ondisk.begin()->first == repop->v);
       for (list<pair<OpRequestRef, version_t> >::iterator i =
-            waiting_for_ondisk[repop->v].begin();
-          i != waiting_for_ondisk[repop->v].end();
+            it->second.begin();
+          i != it->second.end();
           ++i) {
        osd->reply_op_error(i->first, repop->r, repop->v,
                            i->second);
       }
-      waiting_for_ondisk.erase(repop->v);
+      waiting_for_ondisk.erase(it);
     }
   }