diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-01-10 15:16:03 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-01-10 15:16:03 +0100 |
commit | 47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch) | |
tree | a1425a9dbff58b97ef5dcdf169e0d65439513527 /src/modules/m_spanningtree/treesocket1.cpp | |
parent | ae10286658d6bb70e5e22526a004ec1b233f6fba (diff) |
Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 1a8bdd06c..d2fec0118 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -177,7 +177,7 @@ void TreeSocket::OnDataReady() { std::string::size_type rline = line.find('\r'); if (rline != std::string::npos) - line = line.substr(0,rline); + line.erase(rline); if (line.find('\0') != std::string::npos) { SendError("Read null character from socket"); |