Bug 1202148 - Move `current` in only one location in Intervals.h, r=jya
authorMichael Layzell <michael@thelayzells.com>
Sat, 05 Sep 2015 12:00:18 -0400
changeset 295033 571a57cf316fa803b945cb23ef39db4b70ee1cdb
parent 295032 23231987a74c923eb59a47a1a5d0ae86b7fbb114
child 295034 53a8ea3e003f535b99a7899933b20a89b3169c3d
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1202148
milestone43.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 1202148 - Move `current` in only one location in Intervals.h, r=jya
dom/media/Intervals.h
--- a/dom/media/Intervals.h
+++ b/dom/media/Intervals.h
@@ -353,33 +353,28 @@ public:
     // range. We can speed up normalization here.
     if (aInterval.RightOf(last)) {
       mIntervals.AppendElement(aInterval);
       return *this;
     }
 
     ContainerType normalized;
     ElemType current(aInterval);
-    bool inserted = false;
     IndexType i = 0;
     for (; i < mIntervals.Length(); i++) {
       ElemType& interval = mIntervals[i];
       if (current.Touches(interval)) {
         current = current.Span(interval);
       } else if (current.LeftOf(interval)) {
-        normalized.AppendElement(Move(current));
-        inserted = true;
         break;
       } else {
         normalized.AppendElement(Move(interval));
       }
     }
-    if (!inserted) {
-      normalized.AppendElement(Move(current));
-    }
+    normalized.AppendElement(Move(current));
     for (; i < mIntervals.Length(); i++) {
       normalized.AppendElement(Move(mIntervals[i]));
     }
     mIntervals.Clear();
     mIntervals.AppendElements(Move(normalized));
 
     return *this;
   }