aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/network.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/salticidae/network.h')
-rw-r--r--include/salticidae/network.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/salticidae/network.h b/include/salticidae/network.h
index f6623b6..c7b7f66 100644
--- a/include/salticidae/network.h
+++ b/include/salticidae/network.h
@@ -377,8 +377,7 @@ void MsgNetwork<OpcodeType>::Conn::on_read() {
{
if (recv_buffer.size() < Msg::header_size) break;
/* new header available */
- bytearray_t data = recv_buffer.pop(Msg::header_size);
- msg = Msg(data.data());
+ msg = Msg(recv_buffer.pop(Msg::header_size));
msg_state = Conn::PAYLOAD;
}
if (msg_state == Conn::PAYLOAD)
@@ -386,8 +385,7 @@ void MsgNetwork<OpcodeType>::Conn::on_read() {
size_t len = msg.get_length();
if (recv_buffer.size() < len) break;
/* new payload available */
- bytearray_t data = recv_buffer.pop(len);
- msg.set_payload(std::move(data));
+ msg.set_payload(recv_buffer.pop(len));
msg_state = Conn::HEADER;
#ifndef SALTICIDAE_NOCHECKSUM
if (!msg.verify_checksum())