Very little optimization by using a simpler scope_guard when possible

The version with the vector, that can be disabled etc, is “very” slow, so we
use unique_ptr when we don’t need to disable it, and when it only contains
one function
This commit is contained in:
louiz’
2016-10-20 19:32:20 +02:00
parent 6b4d2e8e3e
commit ce06c25e93
3 changed files with 11 additions and 6 deletions
@@ -103,8 +103,6 @@ void TCPSocketHandler::connect(const std::string& address, const std::string& po
this->port = port;
this->use_tls = tls;
utils::ScopeGuard sg;
struct addrinfo* addr_res;
if (!this->connecting)