From 1d89070e5280985ce3212c6ae1f8befb0910e32a Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 23 Jan 2019 16:01:23 -0500 Subject: move captured msg in the closure of send_msg --- include/salticidae/network.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/salticidae/network.h b/include/salticidae/network.h index 0f7ed7d..b36cbe3 100644 --- a/include/salticidae/network.h +++ b/include/salticidae/network.h @@ -694,7 +694,7 @@ void PeerNetwork::send_msg(MsgType &&msg, const NetAddr &paddr) { auto it = id2peer.find(paddr); if (it == id2peer.end()) throw PeerNetworkError("peer does not exist"); - send_msg(msg, it->second->conn); + send_msg(std::move(msg), it->second->conn); }); } /* end: functions invoked by the user loop */ @@ -724,7 +724,7 @@ void ClientNetwork::send_msg(MsgType &&msg, const NetAddr &addr) { [this, addr, msg=std::forward(msg)](ThreadCall::Handle &) { auto it = addr2conn.find(addr); if (it != addr2conn.end()) - send_msg(msg, it->second); + send_msg(std::move(msg), it->second); }); } -- cgit v1.2.3-70-g09d2