Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r=padenot
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Mar 2018 18:33:09 +0200
changeset 412761 8321b37abde4af73e8000cda1688190c39060f54
parent 412760 1b3203bbe43b4659681141da0f832853e84f7a4a
child 412762 594a01bb3d1220e70a7bb8843c08145baaacfd3a
push id102007
push userbvandyk@mozilla.com
push dateWed, 11 Apr 2018 14:04:28 +0000
treeherdermozilla-inbound@d11a0711723e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1447273
milestone61.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 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r=padenot MozReview-Commit-ID: 9pk5xKrYoa6
dom/media/AudioSegment.h
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -176,30 +176,31 @@ struct AudioChunk {
     mDuration = aEnd - aStart;
   }
   StreamTime GetDuration() const { return mDuration; }
   bool CanCombineWithFollowing(const AudioChunk& aOther) const
   {
     if (aOther.mBuffer != mBuffer) {
       return false;
     }
-    if (mBuffer) {
-      NS_ASSERTION(aOther.mBufferFormat == mBufferFormat,
-                   "Wrong metadata about buffer");
-      NS_ASSERTION(aOther.mChannelData.Length() == mChannelData.Length(),
-                   "Mismatched channel count");
-      if (mDuration > INT32_MAX) {
+    if (!mBuffer) {
+      return true;
+    }
+    NS_ASSERTION(aOther.mBufferFormat == mBufferFormat,
+                 "Wrong metadata about buffer");
+    NS_ASSERTION(aOther.mChannelData.Length() == mChannelData.Length(),
+                 "Mismatched channel count");
+    if (mDuration > INT32_MAX) {
+      return false;
+    }
+    for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
+      if (aOther.mChannelData[channel] != AddAudioSampleOffset(mChannelData[channel],
+          mBufferFormat, int32_t(mDuration))) {
         return false;
       }
-      for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
-        if (aOther.mChannelData[channel] != AddAudioSampleOffset(mChannelData[channel],
-            mBufferFormat, int32_t(mDuration))) {
-          return false;
-        }
-      }
     }
     return true;
   }
   bool IsNull() const {
     return mBuffer == nullptr;
   }
   void SetNull(StreamTime aDuration)
   {