Skip to content

Commit 91ca3e8

Browse files
authored
Optimize IXWebSocketTransport chunk buffering (#562)
Use move instead of copy when appending a fragment to _chunks (std::list<std::string>), avoiding one string copy per fragmented-message frame. C++11-compatible (std::move + list::emplace_back) and build-verified with CMAKE_CXX_STANDARD 11.
1 parent e24a2e6 commit 91ca3e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ixwebsocket/IXWebSocketTransport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ namespace ix
618618
// the internal buffer which is slow and can let the internal OS
619619
// receive buffer fill out.
620620
//
621-
_chunks.emplace_back(frameData);
621+
_chunks.emplace_back(std::move(frameData));
622622

623623
if (ws.fin)
624624
{

0 commit comments

Comments
 (0)