]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: user swap() instead of assignment operator
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 16 Jan 2015 19:21:49 +0000 (11:21 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 19 Jan 2015 23:58:02 +0000 (15:58 -0800)
More efficient this way. A fix following code review.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/rgw/cls_rgw_client.cc

index 40a54def6f4403464efc0141063fe4e5471aac37..2beb3cbf4f2f34c9373d90e1ec156514a090b6a7 100644 (file)
@@ -178,7 +178,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid,
     return -EIO;
   }
 
-  *entries = op_ret.entries;
+  entries->swap(op_ret.entries);
   *is_truncated = op_ret.is_truncated;
 
   return 0;
@@ -419,7 +419,7 @@ int cls_rgw_bi_log_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max
     return -EIO;
   }
 
-  entries = ret.entries;
+  entries.swap(ret.entries);
 
   if (truncated)
     *truncated = ret.truncated;
@@ -549,7 +549,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo
     return -EIO;
   }
 
-  entries = ret.entries;
+  entries.swap(ret.entries);
 
   if (truncated)
     *truncated = ret.truncated;