reed-lau 6 лет назад
Родитель
Сommit
e4c7ead20c
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      python/google/protobuf/pyext/message.cc

+ 3 - 3
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;
 }