Skip to content

Commit 8d639fc

Browse files
committed
avoid TelegramFrame copy constructor in TelegramBuffer::take_telegram_frames
1 parent 333dd5c commit 8d639fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vpr/src/server/telegrambuffer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ void TelegramBuffer::take_telegram_frames(std::vector<comm::TelegramFramePtr>& r
4848
uint32_t actual_check_sum = data.calc_check_sum();
4949
if (actual_check_sum == header.body_check_sum()) {
5050
// construct telegram frame if checksum matches
51-
TelegramFramePtr telegram_frame_ptr = std::make_shared<TelegramFrame>(TelegramFrame{header, std::move(data)});
51+
TelegramFramePtr telegram_frame_ptr = std::make_shared<TelegramFrame>();
52+
telegram_frame_ptr->header = header;
53+
telegram_frame_ptr->data = std::move(data);
5254
data.clear(); // post std::move safety step
55+
5356
result.push_back(telegram_frame_ptr);
5457
} else {
5558
m_errors.push_back("wrong checkSums " + std::to_string(actual_check_sum) +" for " + header.info() + " , drop this chunk");

0 commit comments

Comments
 (0)