]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os: use transparent comparator in xattr
authorKefu Chai <kchai@redhat.com>
Mon, 11 Mar 2019 13:38:21 +0000 (21:38 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 20 Mar 2019 08:22:52 +0000 (16:22 +0800)
so we don't need to allocate a temporary string for looking up OI or SS
attribute

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/cyan_object.h

index 6846b1a4dc5f6c66f71b702a8ea2ec4af758a19e..4806589daa9538e791b6df4344bf631afe0ce3d9 100644 (file)
@@ -16,7 +16,9 @@ struct Object : public boost::intrusive_ref_counter<
   using bufferlist = ceph::bufferlist;
 
   bufferlist data;
-  std::map<std::string,bufferptr> xattr;
+  // use transparent comparator for better performance, see
+  // https://en.cppreference.com/w/cpp/utility/functional/less_void
+  std::map<std::string,bufferptr,std::less<>> xattr;
   bufferlist omap_header;
   std::map<std::string,bufferlist> omap;