From e15b2b9cc8cb2db6f4033bbc06328201380821a0 Mon Sep 17 00:00:00 2001 From: Xinying Song Date: Thu, 27 Jul 2017 15:52:54 +0800 Subject: [PATCH] common: use std::move() for better performance use std::move() to avoid extra copy constructions in src/common/OutputDataSocket.cc. Signed-off-by: Xinying Song --- src/common/OutputDataSocket.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/OutputDataSocket.cc b/src/common/OutputDataSocket.cc index f61c9c4453a2e..bbee667f329f9 100644 --- a/src/common/OutputDataSocket.cc +++ b/src/common/OutputDataSocket.cc @@ -298,8 +298,7 @@ void OutputDataSocket::handle_connection(int fd) int OutputDataSocket::dump_data(int fd) { m_lock.Lock(); - list l; - l = data; + list l = std::move(data); data.clear(); data_size = 0; m_lock.Unlock(); -- 2.39.5