Browse Source

perf(capi): use move semantics to optimize std::string

tags/v0.1.0
Timothy Liu 2 years ago
parent
commit
ef03a1a865
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      CAPI/cpp/API/include/utils.hpp

+ 2
- 2
CAPI/cpp/API/include/utils.hpp View File

@@ -472,9 +472,9 @@ namespace THUAI62Proto
{
protobuf::SendMsg sendMsg;
if (binary)
sendMsg.set_binary_message(msg);
sendMsg.set_binary_message(std::move(msg));
else
sendMsg.set_text_message(msg);
sendMsg.set_text_message(std::move(msg));
sendMsg.set_to_player_id(toID);
sendMsg.set_player_id(id);
return sendMsg;


Loading…
Cancel
Save