Skip to content

Commit

Permalink
use move method for SetString
Browse files Browse the repository at this point in the history
  • Loading branch information
reed-lau authored and acozzette committed Aug 9, 2019
1 parent 218df03 commit e4c7ead
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/google/protobuf/pyext/message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e4c7ead

Please sign in to comment.