Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/media r?jya draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:32:18 +0100
changeset 484397 27953f84cb5e5d67f1d8dd8d89959b17e5791b8e
parent 484396 4233b526eb257fa4b7c506a578658290fa7c7b6b
child 484398 265ee704ac9f4ef9a202c2cf0942b7ce3a466378
push id45470
push userbmo:sledru@mozilla.com
push dateWed, 15 Feb 2017 08:57:47 +0000
reviewersjya
bugs1338086
milestone54.0a1
Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/media r?jya MozReview-Commit-ID: IA3oVcvzTQw
dom/media/DecoderTraits.cpp
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -96,52 +96,48 @@ CanHandleCodecsType(const MediaContainer
   MOZ_ASSERT(aType.ExtendedType().HaveCodecs());
 
   // Container type with the MIME type, no codecs.
   const MediaContainerType mimeType(aType.Type());
 
   if (OggDecoder::IsSupportedType(mimeType)) {
     if (OggDecoder::IsSupportedType(aType)) {
       return CANPLAY_YES;
-    } else {
-      // We can only reach this position if a particular codec was requested,
-      // ogg is supported and working: the codec must be invalid.
-      return CANPLAY_NO;
     }
+    // We can only reach this position if a particular codec was requested,
+    // ogg is supported and working: the codec must be invalid.
+    return CANPLAY_NO;
   }
   if (WaveDecoder::IsSupportedType(MediaContainerType(mimeType))) {
     if (WaveDecoder::IsSupportedType(aType)) {
       return CANPLAY_YES;
-    } else {
-      // We can only reach this position if a particular codec was requested,
-      // ogg is supported and working: the codec must be invalid.
-      return CANPLAY_NO;
     }
+    // We can only reach this position if a particular codec was requested,
+    // ogg is supported and working: the codec must be invalid.
+    return CANPLAY_NO;
   }
 #if !defined(MOZ_OMX_WEBM_DECODER)
   if (WebMDecoder::IsSupportedType(mimeType)) {
     if (WebMDecoder::IsSupportedType(aType)) {
       return CANPLAY_YES;
-    } else {
-      // We can only reach this position if a particular codec was requested,
-      // webm is supported and working: the codec must be invalid.
-      return CANPLAY_NO;
     }
+    // We can only reach this position if a particular codec was requested,
+    // webm is supported and working: the codec must be invalid.
+    return CANPLAY_NO;
   }
 #endif
 #ifdef MOZ_FMP4
   if (MP4Decoder::IsSupportedType(mimeType,
                                   /* DecoderDoctorDiagnostics* */ nullptr)) {
     if (MP4Decoder::IsSupportedType(aType, aDiagnostics)) {
       return CANPLAY_YES;
-    } else {
-      // We can only reach this position if a particular codec was requested,
-      // fmp4 is supported and working: the codec must be invalid.
-      return CANPLAY_NO;
     }
+    // We can only reach this position if a particular codec was requested,
+    // fmp4 is supported and working: the codec must be invalid.
+    return CANPLAY_NO;
   }
 #endif
   if (MP3Decoder::IsSupportedType(aType)) {
     return CANPLAY_YES;
   }
   if (ADTSDecoder::IsSupportedType(aType)) {
     return CANPLAY_YES;
   }
@@ -161,17 +157,16 @@ CanHandleCodecsType(const MediaContainer
   if (supportedCodecs.IsEmpty()) {
     return CANPLAY_MAYBE;
   }
 
   if (!supportedCodecs.ContainsAll(aType.ExtendedType().Codecs())) {
     // At least one requested codec is not supported.
     return CANPLAY_NO;
   }
-
   return CANPLAY_YES;
 }
 
 static
 CanPlayStatus
 CanHandleMediaType(const MediaContainerType& aType,
                    DecoderDoctorDiagnostics* aDiagnostics)
 {