Closed Bug 739129 Opened 13 years ago Closed 13 years ago

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

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: heycam, Assigned: heycam)

Details

Attachments

(1 file)

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)
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: nobody → cam
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: