From: Michal Jarzabek Date: Sun, 18 Sep 2016 20:00:26 +0000 (+0100) Subject: osd/PG.h: move shared ptr instead of copying it X-Git-Tag: v11.1.0~145^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e3fc4dbdd67b86737380bf46c15cf0becdacd29e;p=ceph.git osd/PG.h: move shared ptr instead of copying it When we move newmap into osdmap_ref we prevent unnecessary increase and decrease of reference count when newmap goes out of scope. Signed-off-by: Michal Jarzabek --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 1cf85d225866..c3fb92759d89 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -226,7 +226,7 @@ protected: void update_osdmap_ref(OSDMapRef newmap) { assert(_lock.is_locked_by_me()); Mutex::Locker l(map_lock); - osdmap_ref = newmap; + osdmap_ref = std::move(newmap); } OSDMapRef get_osdmap_with_maplock() const {