chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.88k stars 5.18k forks source link

消除void TcpConnection::send(Buffer* buf)中buf的copy #700

Open xb1520 opened 11 months ago

xb1520 commented 11 months ago

消除void TcpConnection::send(Buffer* buf)中buf的copy

retrieveAllAsString函数会生成一个临时的string,造成内存copy,使用std::move消除内存拷贝