]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/rgw_op.cc: avoid copying in for loops
authorMichal Jarzabek <stiopa@gmail.com>
Fri, 22 Apr 2016 17:51:55 +0000 (18:51 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Sat, 23 Apr 2016 13:42:14 +0000 (14:42 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/rgw/rgw_op.cc

index d0508213069b752e09bcab0388cf2b97b071a566..fe50052ce35cb2e3262f75ce6cc773980c9caa51 100644 (file)
@@ -1824,7 +1824,7 @@ static void prepare_add_del_attrs(const map<string, bufferlist>& orig_attrs,
                                   map<string, bufferlist>& out_attrs,
                                   map<string, bufferlist>& 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<string, bufferlist>& orig_attrs,
                                   const set<string>& rmattr_names,
                                   map<string, bufferlist>& 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<string, bufferlist>& orig_attrs,
 static void populate_with_generic_attrs(const req_state * const s,
                                         map<string, bufferlist>& 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();