opt: watch request creation by using std::move to avoid unnecessary deep copy.

This commit is contained in:
henrytien 2024-09-24 17:19:22 +08:00
parent 1f6a0726d9
commit 31faf12b51
1 changed files with 1 additions and 1 deletions

View File

@ -1237,7 +1237,7 @@ etcdv3::AsyncWatchAction::AsyncWatchAction(etcdv3::ActionParameters&& params)
watch_create_req.set_start_revision(parameters.revision);
watch_create_req.set_watch_id(this->watch_id);
watch_req.mutable_create_request()->CopyFrom(watch_create_req);
*watch_req.mutable_create_request() = std::move(watch_create_req);
// wait "create" success (the stream becomes ready)
void* got_tag;