Skip to content
Permalink
Browse files

use move method for SetString

  • Loading branch information...
reed-lau authored and acozzette committed Aug 5, 2019
1 parent 218df03 commit e4c7ead20c971d23f5b8596a871bfd1ed45d301b
Showing with 3 additions and 3 deletions.
  1. +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;
}

0 comments on commit e4c7ead

Please sign in to comment.
You can’t perform that action at this time.