From 8c965718031f0de6401aa30579da2e10afbcaf96 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 31 Jul 2018 20:48:37 -0400 Subject: optimize by replacing RcObj with pointers --- include/salticidae/conn.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/salticidae/conn.h') diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index f8156ee..4f17665 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -147,7 +147,7 @@ class ConnPool { /** The handle to a bi-directional connection. */ using conn_t = RcObj; /** The type of callback invoked when connection status is changed. */ - using conn_callback_t = std::function; + using conn_callback_t = std::function; /** Abstraction for a bi-directional connection. */ class Conn { @@ -228,15 +228,15 @@ class ConnPool { /** Called when new data is available. */ virtual void on_read() { - if (cpool->read_cb) cpool->read_cb(self()); + if (cpool->read_cb) cpool->read_cb(this); } /** Called when the underlying connection is established. */ virtual void on_setup() { - if (cpool->conn_cb) cpool->conn_cb(self()); + if (cpool->conn_cb) cpool->conn_cb(this); } /** Called when the underlying connection breaks. */ virtual void on_teardown() { - if (cpool->conn_cb) cpool->conn_cb(self()); + if (cpool->conn_cb) cpool->conn_cb(this); } }; -- cgit v1.2.3