Skip to content

Commit

Permalink
optimization in Task::bake_response() to avoid unnecessary data coping
Browse files Browse the repository at this point in the history
  • Loading branch information
w0lek committed May 21, 2024
1 parent 563eb54 commit 333dd5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vpr/src/server/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ void Task::bake_response() {
body_opt = ss.str();
}

std::string body = body_opt.value();
std::string body{std::move(body_opt.value())};
m_telegram_header = comm::TelegramHeader::construct_from_data(body, compressor_id);

m_response_buffer.append(m_telegram_header.buffer().begin(), m_telegram_header.buffer().end());
m_response_buffer.append(body);
body.clear();

m_orig_reponse_bytes_num = m_response_buffer.size();
}

Expand Down

0 comments on commit 333dd5c

Please sign in to comment.