DescriptionFix String16's move constructor
String16 had a pseudo move constructor that took a const String16&&. The
problem with this is that the point of moving objects is the ability to
clobber the underlying data. If we look at this particular case, the
move ctor tried to then std::move the underlying std::basic_string<>;
this results in passing a const std::basic_string<>&& to the
basic_string ctor. This resolves to the const std::basic_string<>&
*copy* ctor. So in the end, we haven't moved anything.
Fix this by taking a mutable rvalue reference that allows the moving to
work as expected.
BUG=None
Review-Url: https://codereview.chromium.org/2616973002
Cr-Commit-Position: refs/heads/master@{#42147}
Committed: https://chromium.googlesource.com/v8/v8/+/e6e968d0e693be75cf68c499a1388ec8c68ccb40
Patch Set 1 #
Messages
Total messages: 15 (9 generated)
|