]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: optimize op_target_t and hobject_t constructors 42283/head
authorOr Ozeri <oro@il.ibm.com>
Wed, 30 Jun 2021 06:08:52 +0000 (09:08 +0300)
committerOr Ozeri <oro@il.ibm.com>
Thu, 15 Jul 2021 06:17:46 +0000 (09:17 +0300)
Switch to passing on arguments by reference instead of copying them.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
src/common/hobject.h
src/osdc/Objecter.h

index b7d4895c33ed0678a3ec63621a568ee68575f61e..2fe722661c61f41a01151baabd48a43c2fcb442a 100644 (file)
@@ -130,8 +130,8 @@ public:
     return hobject_t_max();
   }
 
-  hobject_t(object_t oid, const std::string& key, snapid_t snap, uint32_t hash,
-           int64_t pool, std::string nspace)
+  hobject_t(const object_t& oid, const std::string& key, snapid_t snap,
+            uint32_t hash, int64_t pool, const std::string& nspace)
     : oid(oid), snap(snap), hash(hash), max(false),
       pool(pool), nspace(nspace),
       key(oid.name == key ? std::string() : key) {
@@ -139,7 +139,7 @@ public:
   }
 
   hobject_t(const sobject_t &soid, const std::string &key, uint32_t hash,
-           int64_t pool, std::string nspace)
+           int64_t pool, const std::string& nspace)
     : oid(soid.oid), snap(soid.snap), hash(hash), max(false),
       pool(pool), nspace(nspace),
       key(soid.oid.name == key ? std::string() : key) {
index e4c7ab4b4b6af24699ccacd03580a832365ff825..b67f0c712993b3a1ada35ba3f83a947f806240ed 100644 (file)
@@ -1793,7 +1793,7 @@ public:
 
     epoch_t last_force_resend = 0;
 
-    op_target_t(object_t oid, object_locator_t oloc, int flags)
+    op_target_t(const object_t& oid, const object_locator_t& oloc, int flags)
       : flags(flags),
        base_oid(oid),
        base_oloc(oloc)