Last Comment Bug 739129 - give nsTArray convenience functions to get the last element of the array
: give nsTArray convenience functions to get the last element of the array
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: Cameron McCormack (:heycam)
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-25 21:45 PDT by Cameron McCormack (:heycam)
Modified: 2012-03-27 05:23 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
add LastElement and SafeLastElement functions to nsTArray (1.20 KB, patch)
2012-03-25 21:45 PDT, Cameron McCormack (:heycam)
dbaron: review+
Details | Diff | Splinter Review

Description Cameron McCormack (:heycam) 2012-03-25 21:45:34 PDT
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".
Comment 1 David Baron :dbaron: ⌚️UTC-10 2012-03-26 15:44:37 PDT
Comment on attachment 609207 [details] [diff] [review]
add LastElement and SafeLastElement functions to nsTArray

r=dbaron
Comment 2 Cameron McCormack (:heycam) 2012-03-26 15:49:53 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/c7cce5198d83
Comment 3 Ed Morley [:emorley] 2012-03-27 05:23:12 PDT
https://hg.mozilla.org/mozilla-central/rev/c7cce5198d83

Note You need to log in before you can comment on or make changes to this bug.