Closed
Bug 1053420
Opened 10 years ago
Closed 10 years ago
Improve new nsTArray rvalue reference methods
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: neil, Assigned: neil)
References
Details
Attachments
(1 file)
3.85 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
The new rvalue reference versions of nsTArray::AppendElement and InsertElementAt want to move their parameter to the Construct function. Since this isn't a template-deduced reference parameter, they should Move rather than Forward. It looks as if jrmuizel did originally try to template on the parameter to AppendElement but was just trying various combinations until it compiled :-\ Note that template<class Item> elem_type* AppendElement(elem_type&& aItem) matches non-const lvalues which is why you can't blindly Move them. In fact it quite happily takes const lvalues too, making the other overload redundant.
Assignee | ||
Comment 1•10 years ago
|
||
My second try run (the first got hit by our infra issues) for my suggested AppendElement change seems to be reasonably green. Patch is at https://hg.mozilla.org/try/rev/9922524dc8dd
Assignee | ||
Comment 2•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=34a6b9a59e6d
Updated•10 years ago
|
Attachment #8473357 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 3•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2976adaf3278
Assignee | ||
Comment 4•10 years ago
|
||
I botched the bug# on my checkin comment. Oops. https://hg.mozilla.org/mozilla-central/rev/2976adaf3278
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•