]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: use std::move() for better performance 16620/head
authorXinying Song <songxinying@cloudin.cn>
Thu, 27 Jul 2017 07:52:54 +0000 (15:52 +0800)
committerXinying Song <songxinying@cloudin.cn>
Thu, 27 Jul 2017 07:52:54 +0000 (15:52 +0800)
use std::move() to avoid extra copy constructions in src/common/OutputDataSocket.cc.

Signed-off-by: Xinying Song <songxinying@cloudin.cn>
src/common/OutputDataSocket.cc

index f61c9c4453a2e7b43d25e7d8dd67fd5a1980b226..bbee667f329f91083cc361c26e4ab86f01e26866 100644 (file)
@@ -298,8 +298,7 @@ void OutputDataSocket::handle_connection(int fd)
 int OutputDataSocket::dump_data(int fd)
 {
   m_lock.Lock(); 
-  list<bufferlist> l;
-  l = data;
+  list<bufferlist> l = std::move(data);
   data.clear();
   data_size = 0;
   m_lock.Unlock();