Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r=padenot a=jcristau
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Mar 2018 18:33:09 +0200
changeset 460736 432a01ff2f83fb4e23f815c250a8eb07632ab3fc
parent 460735 ce914d685d4950e0aa70d76534481edd6200ecdc
child 460737 d83cf78e4b25a9c649b3974b279280f6b3e74863
push id9031
push userarchaeopteryx@coole-files.de
push dateThu, 12 Apr 2018 16:02:00 +0000
treeherdermozilla-beta@e4795b79e8c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, jcristau
bugs1447273
milestone60.0
Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r=padenot a=jcristau MozReview-Commit-ID: 9pk5xKrYoa6
dom/media/AudioSegment.h
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -165,30 +165,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)
   {