]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMap: use deepish_copy_from in remove_redundant_temporaries 1137/head
authorSage Weil <sage@inktank.com>
Tue, 28 Jan 2014 01:13:19 +0000 (17:13 -0800)
committerSage Weil <sage@inktank.com>
Tue, 28 Jan 2014 01:13:19 +0000 (17:13 -0800)
Better not to open-code it.  We do a bit of extra work here, but it's worth
it.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSDMap.cc

index 9032390b041f86e4d13e2d8963f70cad764f6a45..d4c36f5ec14cfcf3b8547da5387624c57f25cdcb 100644 (file)
@@ -1048,8 +1048,8 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap
     }
   }
   if (!osdmap.primary_temp->empty()) {
-    OSDMap templess(osdmap);
-    templess.primary_temp.reset(new map<pg_t,int>(*osdmap.primary_temp));
+    OSDMap templess;
+    templess.deepish_copy_from(osdmap);
     templess.primary_temp->clear();
     for (map<pg_t,int>::iterator p = osdmap.primary_temp->begin();
         p != osdmap.primary_temp->end();