]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: async: trim already sent for outcoming_bl more efficiently 7970/head
authorYan Jun <yan.jun8@zte.com.cn>
Wed, 9 Mar 2016 08:05:39 +0000 (16:05 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Mon, 14 Mar 2016 02:15:46 +0000 (10:15 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/msg/async/AsyncConnection.cc

index bbe8875c595cf0c03ca892849a7a96e3a2afe0fc..561d9f54f3dc6d4867e87450f0a7d756a785bf53 100644 (file)
@@ -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();
     }