Closed Bug 1654991 Opened 5 years ago Closed 5 years ago

Move construction/assignment of nsTArray is too complex

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: sg, Assigned: sg)

References

Details

Attachments

(3 files)

Move construction/assignment (and similarly Assign/AppendElements operations moving from a source array) should be simple operations. However, right now they are based on SwapArrayElements, which due to its generality is quite complex. This can be simplified based on the knowledge that the target array is empty. For move construction, this can even be further simplified when we know that the target array is not an AutoTArray.

See Also: → 1654992
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cf3bfb91d98c Simplify move constructor of nsTArray_Impl. r=froydnj https://hg.mozilla.org/integration/autoland/rev/6a7964ba549f Provide and use special case of ShrinkCapacityToZero. r=froydnj https://hg.mozilla.org/integration/autoland/rev/a353dd5b3f08 Simplify moving operator=, Assign and AppendElements. r=froydnj
See Also: → 1656924

The defect was in the patch for Bug 1654992, which I now fixed.

Flags: needinfo?(sgiesecke)
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/58b72de320e1 Simplify move constructor of nsTArray_Impl. r=froydnj https://hg.mozilla.org/integration/autoland/rev/649d2bc6ad86 Provide and use special case of ShrinkCapacityToZero. r=froydnj https://hg.mozilla.org/integration/autoland/rev/6f09ee25da28 Simplify moving operator=, Assign and AppendElements. r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Regressions: 1658701
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: