]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: drop rgw_obj_key::to_str() 49190/head
authorKefu Chai <tchaikov@gmail.com>
Sat, 10 Dec 2022 02:31:21 +0000 (10:31 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sat, 10 Dec 2022 04:08:38 +0000 (12:08 +0800)
commit1168be8b0433cb00ed6d8cde25d5fa53e07e9024
tree8008a5242a2e4bb40b1944ccac7506d5cf3e2c32
parenta322cb63307e14e2f5e4a5d41f33dba2d374f476
rgw: drop rgw_obj_key::to_str()

rgw_obj_key::to_str() is mainly used by operator<<(ostream&, ..), so
we can just implement it with the specialization of
fmt::formatter<rgw_obj_key>. and let operator<<(ostream&, ..) to
call into fmt::format(..):

1. for better readability and
2. for probably better performance -- we don't need to do deep copy
   for constructing a `std::string` from a `char[]`.
3. for better standard compliance -- we don't need to use variable-length
   array in C++ code. it is a part of C99 standard. but not a C++ standard.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/rgw/driver/rados/rgw_data_sync.cc
src/rgw/rgw_obj_types.h