summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-01-10 15:16:03 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-01-10 15:16:03 +0100
commit47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch)
treea1425a9dbff58b97ef5dcdf169e0d65439513527 /src/modules/extra
parentae10286658d6bb70e5e22526a004ec1b233f6fba (diff)
Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp2
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp2
2 files changed, 2 insertions, 2 deletions
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;
}