From: Changcheng Liu Date: Mon, 27 Jul 2020 07:21:18 +0000 (+0800) Subject: rgw: use copy-by-value with string_view instead of reference X-Git-Tag: v16.1.0~1380^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e487cd67ded1ac825c8f5827ee3727eb75937a9;p=ceph.git rgw: use copy-by-value with string_view instead of reference 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 --- diff --git a/src/rgw/rgw_cors.h b/src/rgw/rgw_cors.h index c183b8bc29d..6679900953b 100644 --- a/src/rgw/rgw_cors.h +++ b/src/rgw/rgw_cors.h @@ -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("*"))