Commit f0012003 authored by aligungr's avatar aligungr

Performance improvements

parent 473ad7c9
......@@ -39,9 +39,8 @@ void udp::UdpServerTask::onLoop()
int size = server->Receive(buffer, BUFFER_SIZE, TIMEOUT_MS, peerAddress);
if (size > 0)
{
std::vector<uint8_t> v(size);
std::memcpy(v.data(), buffer, size);
targetTask->push(std::make_unique<NwUdpServerReceive>(OctetString{std::move(v)}, peerAddress));
targetTask->push(std::make_unique<NwUdpServerReceive>(OctetString::FromArray(buffer, static_cast<size_t>(size)),
peerAddress));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment