Closed Bug 1365802 Opened 2 years ago Closed 2 years ago

VariantImplementation::moveConstruct should Move its && parameter

Categories

(Core :: MFBT, enhancement)

55 Branch
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: gerald, Assigned: gerald)

Details

Attachments

(1 file)

Nathan Froyd [:froydnj] from bug 1338389 comment #17:
> https://reviewboard.mozilla.org/r/137024/#review142576
> 
> ::: mfbt/Variant.h:253
> >    template<typename Variant>
> >    static void moveConstruct(void* aLhs, Variant&& aRhs) {
> > ...
> >        Next::moveConstruct(aLhs, aRhs);
> 
> Unrelated: this needs to be `moveConstruct(aLhs, Move(aRhs))`, doesn't it? 

Right, a temporary copy of aRhs is made and passed to the called moveConstruct as rvalue.
Adding Move would remove the copy.
Comment on attachment 8868840 [details]
Bug 1365802 - In VariantImplementation::moveConstruct, move the aRhs rvalue to the next moveConstruct -

https://reviewboard.mozilla.org/r/140428/#review145158
Attachment #8868840 - Flags: review?(nfroyd) → review+
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/97ce14cb28f9
In VariantImplementation::moveConstruct, move the aRhs rvalue to the next moveConstruct - r=froydnj
https://hg.mozilla.org/mozilla-central/rev/97ce14cb28f9
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.