diff options
author | Determinant <[email protected]> | 2018-08-01 13:30:43 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-08-01 13:30:43 -0400 |
commit | bc078abd9d5fcc420dfbcda06869a95aba39b1ea (patch) | |
tree | 41ecd1a541abd7744d18f8c118f1984bafbe75b0 /test/bench_network.cpp | |
parent | 8c965718031f0de6401aa30579da2e10afbcaf96 (diff) |
use reference in place of pointers
Diffstat (limited to 'test/bench_network.cpp')
-rw-r--r-- | test/bench_network.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/bench_network.cpp b/test/bench_network.cpp index c2406d5..19f0dd9 100644 --- a/test/bench_network.cpp +++ b/test/bench_network.cpp @@ -109,8 +109,8 @@ struct MyNet: public MsgNetworkByteOp { net->name.c_str()); /* send the first message through this connection */ net->ev_period_send = Event(net->ec, -1, 0, - [net, this](int, short) { - net->send_msg(MsgBytes(256), this); + [net, conn = self()](int, short) { + net->send_msg(MsgBytes(256), *conn); net->ev_period_send.add_with_timeout(0); }); net->ev_period_send.add_with_timeout(0); @@ -133,7 +133,7 @@ struct MyNet: public MsgNetworkByteOp { return new Conn(); } - void on_receive_bytes(MsgBytes &&msg, const Conn *conn) { + void on_receive_bytes(MsgBytes &&msg, Conn &conn) { nrecv++; } }; |