From: Kefu Chai Date: Thu, 27 Apr 2017 22:25:40 +0000 (+0800) Subject: mon/OSDMonitor: use emplace() to avoid creating temporary elements X-Git-Tag: v12.0.3~168^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14849%2Fhead;p=ceph.git mon/OSDMonitor: use emplace() to avoid creating temporary elements Signed-off-by: Kefu Chai --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index cf069c6b4b052..80fca770ac414 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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; }