From: Adam C. Emerson Date: Fri, 17 Jul 2020 06:20:26 +0000 (-0400) Subject: rgw: Remove unneded copy in ranged initializer X-Git-Tag: wip-pdonnell-testing-20200918.022351~598^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=96063c3ebb3a47eaa8c92b8402d0954c29ff5961;p=ceph-ci.git rgw: Remove unneded copy in ranged initializer Signed-off-by: Adam C. Emerson --- diff --git a/src/rgw/rgw_rest_pubsub.cc b/src/rgw/rgw_rest_pubsub.cc index 65f783a293e..3144cd072c1 100644 --- a/src/rgw/rgw_rest_pubsub.cc +++ b/src/rgw/rgw_rest_pubsub.cc @@ -39,7 +39,7 @@ public: if (!validate_and_update_endpoint_secret(dest, s->cct, *(s->info.env))) { return -EINVAL; } - for (const auto param : s->info.args.get_params()) { + for (const auto& param : s->info.args.get_params()) { if (param.first == "Action" || param.first == "Name" || param.first == "PayloadHash") { continue; } @@ -299,7 +299,7 @@ void RGWHandler_REST_PSTopic_AWS::rgw_topic_parse_input() { } } // update the regular args with the content of the attribute map - for (const auto attr : map) { + for (const auto& attr : map) { s->info.args.append(attr.second.get_key(), attr.second.get_value()); } } diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 7b01b57dc02..a06e2cd328a 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -1200,7 +1200,7 @@ static void bulkdelete_respond(const unsigned num_deleted, if (!failures.empty()) { int reason = ERR_INVALID_REQUEST; - for (const auto fail_desc : failures) { + for (const auto& fail_desc : failures) { if (-ENOENT != fail_desc.err && -EACCES != fail_desc.err) { reason = fail_desc.err; } @@ -1223,7 +1223,7 @@ static void bulkdelete_respond(const unsigned num_deleted, encode_json("Response Status", resp_status, &formatter); formatter.open_array_section("Errors"); - for (const auto fail_desc : failures) { + for (const auto& fail_desc : failures) { formatter.open_array_section("object"); stringstream ss_name; @@ -1353,7 +1353,7 @@ static void dump_object_metadata(const DoutPrefixProvider* dpp, struct req_state } } - for (const auto kv : response_attrs) { + for (const auto& kv : response_attrs) { dump_header(s, kv.first, kv.second); } @@ -2979,7 +2979,7 @@ int RGWHandler_REST_SWIFT::init_from_header(struct req_state* const s, /* Erase all pre-defined prefixes like "AUTH_" or "KEY_". */ const vector skipped_prefixes = { "AUTH_", "KEY_" }; - for (const auto pfx : skipped_prefixes) { + for (const auto& pfx : skipped_prefixes) { const size_t comp_len = min(account_name.length(), pfx.length()); if (account_name.compare(0, comp_len, pfx) == 0) { /* Prefix is present. Drop it. */