]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: use emplace() to avoid creating temporary elements 14849/head
authorKefu Chai <kchai@redhat.com>
Thu, 27 Apr 2017 22:25:40 +0000 (06:25 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 27 Apr 2017 22:25:49 +0000 (06:25 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc

index cf069c6b4b052e067f585e3d6ff0b32abdb04d20..80fca770ac414a66a7d9f207e25132242c40c10c 100644 (file)
@@ -3245,8 +3245,8 @@ epoch_t OSDMonitor::send_pg_creates(int osd, Connection *con, epoch_t next)
       // Need the create time from the monitor using its clock to set
       // last_scrub_stamp upon pg creation.
       const auto& creation = creating_pgs.pgs[pg];
-      m->mkpg[pg] = pg_create_t{creation.first, pg, 0};
-      m->ctimes[pg] = creation.second;
+      m->mkpg.emplace(pg, pg_create_t{creation.first, pg, 0});
+      m->ctimes.emplace(pg, creation.second);
       dout(20) << __func__ << " will create " << pg
               << " at " << creation.first << dendl;
     }