From 8839ccbf1512241ca74ad885740b83a5bb70095f Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Fri, 22 Apr 2016 18:51:55 +0100 Subject: [PATCH] rgw/rgw_op.cc: avoid copying in for loops Signed-off-by: Michal Jarzabek --- src/rgw/rgw_op.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index d0508213069..fe50052ce35 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1824,7 +1824,7 @@ static void prepare_add_del_attrs(const map& orig_attrs, map& out_attrs, map& out_rmattrs) { - for (const auto kv : orig_attrs) { + for (const auto& kv : orig_attrs) { const string& name = kv.first; /* Check if the attr is user-defined metadata item. */ @@ -1842,7 +1842,7 @@ static void prepare_add_del_attrs(const map& orig_attrs, const set& rmattr_names, map& out_attrs) { - for (const auto kv : orig_attrs) { + for (const auto& kv : orig_attrs) { const string& name = kv.first; /* Check if the attr is user-defined metadata item. */ @@ -1867,7 +1867,7 @@ static void prepare_add_del_attrs(const map& orig_attrs, static void populate_with_generic_attrs(const req_state * const s, map& out_attrs) { - for (auto kv : s->generic_attrs) { + for (const auto& kv : s->generic_attrs) { bufferlist& attrbl = out_attrs[kv.first]; const string& val = kv.second; attrbl.clear(); -- 2.47.3