give nsTArray convenience functions to get the last element of the array

RESOLVED FIXED in mozilla14

Status

()

Core
XPCOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: heycam, Assigned: heycam)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 609207 [details] [diff] [review]
add LastElement and SafeLastElement functions to nsTArray

I find myself often writing things like myArray[myArray.Length() - 1].  It
would be nice to have functions that return a reference to the last element
of the array to avoid having to repeat "myArray".
Attachment #609207 - Flags: review?(doug.turner)

Updated

6 years ago
Attachment #609207 - Flags: review?(doug.turner) → review?(dbaron)
Comment on attachment 609207 [details] [diff] [review]
add LastElement and SafeLastElement functions to nsTArray

r=dbaron
Attachment #609207 - Flags: review?(dbaron) → review+
(Assignee)

Comment 2

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/c7cce5198d83
Assignee: nobody → cam
Status: NEW → ASSIGNED

Comment 3

6 years ago
https://hg.mozilla.org/mozilla-central/rev/c7cce5198d83
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.