From 6d42b5f99701034d35e31a8a211fbae87553ffee Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 6 Jan 2020 15:52:04 -0500 Subject: [PATCH] reduce logic calls --- llarp/ev/ev_libuv.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/llarp/ev/ev_libuv.cpp b/llarp/ev/ev_libuv.cpp index 50acfb331..348ea5748 100644 --- a/llarp/ev/ev_libuv.cpp +++ b/llarp/ev/ev_libuv.cpp @@ -105,8 +105,7 @@ namespace libuv OnOutboundConnect(uv_connect_t* c, int status) { conn_glue* self = static_cast< conn_glue* >(c->data); - LoopCall(self->Stream(), - std::bind(&conn_glue::HandleConnectResult, self, status)); + self->HandleConnectResult(status); c->data = nullptr; } @@ -140,8 +139,7 @@ namespace libuv if(nread >= 0) { auto* conn = static_cast< conn_glue* >(stream->data); - LoopCall(stream, std::bind(&conn_glue::Read, conn, buf->base, nread)); - return; + conn->Read(buf->base, nread); } else if(nread < 0) { @@ -166,7 +164,6 @@ namespace libuv const llarp_buffer_t buf(ptr, sz); m_Conn.read(&m_Conn, buf); } - delete[] ptr; } void