From: Yan Jun Date: Wed, 9 Mar 2016 08:05:39 +0000 (+0800) Subject: msg: async: trim already sent for outcoming_bl more efficiently X-Git-Tag: v10.1.0~43^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=40f7e6e4be2b9e664b3ee83efdda542768943b2c;p=ceph.git msg: async: trim already sent for outcoming_bl more efficiently Signed-off-by: Yan Jun --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index bbe8875c595c..561d9f54f3dc 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -395,9 +395,7 @@ ssize_t AsyncConnection::_try_send(bool send, bool more) // trim already sent for outcoming_bl if (sent_bytes) { if (sent_bytes < outcoming_bl.length()) { - bufferlist bl; - outcoming_bl.splice(sent_bytes, outcoming_bl.length()-sent_bytes, &bl); - bl.swap(outcoming_bl); + outcoming_bl.splice(0, sent_bytes); } else { outcoming_bl.clear(); }