Bug 1227396: P3. Add IntervalSet::LastInterval method. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 24 Nov 2015 19:41:20 +1100
changeset 274533 c5689e8fe1e442de8d8cd8bb2843cef34c8eac11
parent 274532 fb6bf94d90846562c3bafc7f2e8e3157282d74c2
child 274534 5ececa0775416a4a9f891567210df03ce7667a5f
push id68621
push userjyavenard@mozilla.com
push dateMon, 30 Nov 2015 00:49:17 +0000
treeherdermozilla-inbound@fd4d78b89cc0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1227396
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1227396: P3. Add IntervalSet::LastInterval method. r=gerald
dom/media/Intervals.h
--- a/dom/media/Intervals.h
+++ b/dom/media/Intervals.h
@@ -647,16 +647,28 @@ public:
     return mIntervals.end();
   }
 
   typename ContainerType::const_iterator end() const
   {
     return mIntervals.end();
   }
 
+  ElemType& LastInterval()
+  {
+    MOZ_ASSERT(!mIntervals.IsEmpty());
+    return mIntervals.LastElement();
+  }
+
+  const ElemType& LastInterval() const
+  {
+    MOZ_ASSERT(!mIntervals.IsEmpty());
+    return mIntervals.LastElement();
+  }
+
 protected:
   ContainerType mIntervals;
 
 private:
   void Normalize()
   {
     if (mIntervals.Length() >= 2) {
       ContainerType normalized;