aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-01-23 16:01:23 -0500
committerDeterminant <[email protected]>2019-01-23 16:01:23 -0500
commit1d89070e5280985ce3212c6ae1f8befb0910e32a (patch)
treec76ad7b83d48aa378b718b137da89f692cf9300f /include
parentb84b00cb9d17a51b2667716229dd3ecde756b709 (diff)
move captured msg in the closure of send_msg
Diffstat (limited to 'include')
-rw-r--r--include/salticidae/network.h4
1 files 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<O, _, __>::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<OpcodeType>::send_msg(MsgType &&msg, const NetAddr &addr) {
[this, addr, msg=std::forward<MsgType>(msg)](ThreadCall::Handle &) {
auto it = addr2conn.find(addr);
if (it != addr2conn.end())
- send_msg(msg, it->second);
+ send_msg(std::move(msg), it->second);
});
}