From 1e487cd67ded1ac825c8f5827ee3727eb75937a9 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Mon, 27 Jul 2020 15:21:18 +0800 Subject: [PATCH] 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 --- src/rgw/rgw_cors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_cors.h b/src/rgw/rgw_cors.h index c183b8bc29d7..6679900953b6 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("*")) -- 2.47.3