From 47dda4f61512f6047f2b1dcccd1943aab74726e3 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 10 Jan 2015 15:16:03 +0100 Subject: Reduce std::string::substr() usage substr() returns a new string while erase() and assign() modify the existing one --- src/modules/extra/m_ssl_gnutls.cpp | 2 +- src/modules/extra/m_ssl_openssl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 74b66d2de..be642a79d 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -909,7 +909,7 @@ info_done_dealloc: } else if (ret > 0) { - sendq = sendq.substr(ret); + sendq.erase(0, ret); SocketEngine::ChangeEventMask(user, FD_WANT_SINGLE_WRITE); return 0; } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index a0c30bb9e..b38478d6d 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -641,7 +641,7 @@ class OpenSSLIOHook : public SSLIOHook } else if (ret > 0) { - buffer = buffer.substr(ret); + buffer.erase(0, ret); SocketEngine::ChangeEventMask(user, FD_WANT_SINGLE_WRITE); return 0; } -- cgit v1.2.3