Bug 1273965 part 1: Collapse some one-liner else-after-return patterns in MediaPipelineFactory.cpp. r=bwc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 18 May 2016 10:55:57 -0700
changeset 298042 82a22f492f566c951dea149f70c631237f930b66
parent 298041 3f4d7167f19d6a6b8c4429a2e935c1c9ca218606
child 298043 fb4a38912157551a21c0a3b5f7e6a912989fe7d4
push id30270
push userryanvm@gmail.com
push dateThu, 19 May 2016 16:47:16 +0000
treeherdermozilla-central@1806d405c871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1273965
milestone49.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 1273965 part 1: Collapse some one-liner else-after-return patterns in MediaPipelineFactory.cpp. r=bwc MozReview-Commit-ID: KXhQrteqdtI
media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
--- a/media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
@@ -937,19 +937,18 @@ MediaPipelineFactory::EnsureExternalCode
            if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION_ENCODE, discardFailureId, &status))) {
              if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
                NS_WARNING("VP8 encoder hardware is not whitelisted: disabling.\n");
              } else {
                VideoEncoder* encoder = nullptr;
                encoder = MediaCodecVideoCodec::CreateEncoder(MediaCodecVideoCodec::CodecType::CODEC_VP8);
                if (encoder) {
                  return aConduit.SetExternalSendCodec(aConfig, encoder);
-               } else {
-                 return kMediaConduitNoError;
                }
+               return kMediaConduitNoError;
              }
            }
          }
        }
      } else {
 #ifdef MOZILLA_INTERNAL_API
        bool enabled = mozilla::Preferences::GetBool("media.navigator.hardware.vp8_decode.acceleration_enabled", false);
 #else
@@ -963,19 +962,18 @@ MediaPipelineFactory::EnsureExternalCode
            if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION_DECODE, discardFailureId, &status))) {
              if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
                NS_WARNING("VP8 decoder hardware is not whitelisted: disabling.\n");
              } else {
                VideoDecoder* decoder;
                decoder = MediaCodecVideoCodec::CreateDecoder(MediaCodecVideoCodec::CodecType::CODEC_VP8);
                if (decoder) {
                  return aConduit.SetExternalRecvCodec(aConfig, decoder);
-               } else {
-                 return kMediaConduitNoError;
                }
+               return kMediaConduitNoError;
              }
            }
          }
        }
      }
 #endif
      return kMediaConduitNoError;
   }
@@ -992,32 +990,30 @@ MediaPipelineFactory::EnsureExternalCode
 #ifdef MOZ_WEBRTC_OMX
       encoder =
           OMXVideoCodec::CreateEncoder(OMXVideoCodec::CodecType::CODEC_H264);
 #else
       encoder = GmpVideoCodec::CreateEncoder();
 #endif
       if (encoder) {
         return aConduit.SetExternalSendCodec(aConfig, encoder);
-      } else {
-        return kMediaConduitInvalidSendCodec;
       }
+      return kMediaConduitInvalidSendCodec;
     } else {
       VideoDecoder* decoder = nullptr;
 #ifdef MOZ_WEBRTC_OMX
       decoder =
           OMXVideoCodec::CreateDecoder(OMXVideoCodec::CodecType::CODEC_H264);
 #else
       decoder = GmpVideoCodec::CreateDecoder();
 #endif
       if (decoder) {
         return aConduit.SetExternalRecvCodec(aConfig, decoder);
-      } else {
-        return kMediaConduitInvalidReceiveCodec;
       }
+      return kMediaConduitInvalidReceiveCodec;
     }
     NS_NOTREACHED("Shouldn't get here!");
   } else {
     MOZ_MTLOG(ML_ERROR,
               "Invalid video codec configured: " << aConfig->mName.c_str());
     return aIsSend ? kMediaConduitInvalidSendCodec
                    : kMediaConduitInvalidReceiveCodec;
   }