From 954f123350e8c6233ae56d17a428910269691a80 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 28 Apr 2017 06:25:40 +0800 Subject: [PATCH] mon/OSDMonitor: use emplace() to avoid creating temporary elements Signed-off-by: Kefu Chai --- src/mon/OSDMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index cf069c6b4b0..80fca770ac4 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; } -- 2.47.3