Closed Bug 1642949 Opened 4 years ago Closed 4 years ago

Avoid suboptimal uses of nsTArray::RemoveElementAt when removing the last element

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: sg, Assigned: sg)

References

Details

Attachments

(1 file)

Uses of nsTArray::RemoveElementAt where the element index is known to be the last one should better use nsTArray::RemoveLastElement, which is more optimal. In cases where the last element needs to be accessed at the same time, nsTArray::PopLastElement should be used.

(Actually, this is a reinstantiation of Bug 1445302)

Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c827da9d847
Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/127b5f65cf50
Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: