]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use copy-by-value with string_view instead of reference
authorChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 27 Jul 2020 07:21:18 +0000 (15:21 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 28 Jul 2020 02:48:54 +0000 (10:48 +0800)
No need to use reference if it could be solved by copy-by-value
without downgrading performance.
reference guide:
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/rgw/rgw_cors.h

index c183b8bc29d75cad6c875c5c21fd23c5e6dab423..6679900953b6d9b376d829272fe32c2c88e0e572 100644 (file)
@@ -126,7 +126,7 @@ class RGWCORSConfiguration
 };
 WRITE_CLASS_ENCODER(RGWCORSConfiguration)
 
-static inline int validate_name_string(string& o) {
+static inline int validate_name_string(std::string_view o) {
   if (o.length() == 0)
     return -1;
   if (o.find_first_of("*") != o.find_last_of("*"))