From e4c7ead20c971d23f5b8596a871bfd1ed45d301b Mon Sep 17 00:00:00 2001 From: reed-lau Date: Mon, 5 Aug 2019 19:30:57 +0800 Subject: [PATCH] use move method for SetString --- python/google/protobuf/pyext/message.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index dc2f772250bac..43e5896562bdb 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -788,11 +788,11 @@ bool CheckAndSetString( string value_string(value, value_len); if (append) { - reflection->AddString(message, descriptor, value_string); + reflection->AddString(message, descriptor, std::move(value_string)); } else if (index < 0) { - reflection->SetString(message, descriptor, value_string); + reflection->SetString(message, descriptor, std::move(value_string)); } else { - reflection->SetRepeatedString(message, descriptor, index, value_string); + reflection->SetRepeatedString(message, descriptor, index, std::move(value_string)); } return true; }