Bug 1387002 - Replace .size() by .empty() when applicable in webrtc & mtransport r=jesup
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 04 Aug 2017 09:36:19 +0200
changeset 374029 33e2405b3ddd91ff79180846fb311617e5aab679
parent 374028 03ed4db276ca6476eee7ba7e6dfb89618c286932
child 374030 8dab5fd85c70ceb1bc9242af3b5d52650c0da97e
push id32312
push userarchaeopteryx@coole-files.de
push dateFri, 11 Aug 2017 09:55:13 +0000
treeherdermozilla-central@f74094603063 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1387002
milestone57.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 1387002 - Replace .size() by .empty() when applicable in webrtc & mtransport r=jesup MozReview-Commit-ID: 4DyftBRDEcU
dom/media/webrtc/MediaEngineCameraVideoSource.cpp
dom/media/webrtc/MediaTrackConstraints.cpp
dom/media/webrtc/MediaTrackConstraints.h
media/mtransport/nr_socket_prsock.cpp
media/mtransport/nricectx.cpp
media/mtransport/nricemediastream.cpp
media/mtransport/test/test_nr_socket_ice_unittest.cpp
media/webrtc/signaling/gtest/jsep_session_unittest.cpp
media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
media/webrtc/signaling/src/jsep/JsepCodecDescription.h
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/src/jsep/JsepTrack.cpp
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipelineFilter.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
media/webrtc/signaling/src/sdp/SdpAttribute.cpp
media/webrtc/signaling/src/sdp/SdpHelper.cpp
media/webrtc/signaling/src/sdp/SdpMediaSection.cpp
media/webrtc/signaling/src/sdp/SipccSdpAttributeList.cpp
--- a/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
@@ -220,17 +220,17 @@ MediaEngineCameraVideoSource::ChooseCapa
     const MediaEnginePrefs &aPrefs,
     const nsString& aDeviceId)
 {
   if (MOZ_LOG_TEST(GetMediaManagerLog(), LogLevel::Debug)) {
     LOG(("ChooseCapability: prefs: %dx%d @%d-%dfps",
          aPrefs.GetWidth(), aPrefs.GetHeight(),
          aPrefs.mFPS, aPrefs.mMinFPS));
     LogConstraints(aConstraints);
-    if (aConstraints.mAdvanced.size()) {
+    if (!aConstraints.mAdvanced.empty()) {
       LOG(("Advanced array[%zu]:", aConstraints.mAdvanced.size()));
       for (auto& advanced : aConstraints.mAdvanced) {
         LogConstraints(advanced);
       }
     }
   }
 
   size_t num = NumCapabilities();
--- a/dom/media/webrtc/MediaTrackConstraints.cpp
+++ b/dom/media/webrtc/MediaTrackConstraints.cpp
@@ -215,46 +215,46 @@ NormalizedConstraintSet::StringRange::Se
       }
     }
   }
 }
 
 auto
 NormalizedConstraintSet::StringRange::Clamp(const ValueType& n) const -> ValueType
 {
-  if (!mExact.size()) {
+  if (mExact.empty()) {
     return n;
   }
   ValueType result;
   for (auto& entry : n) {
     if (mExact.find(entry) != mExact.end()) {
       result.insert(entry);
     }
   }
   return result;
 }
 
 bool
 NormalizedConstraintSet::StringRange::Intersects(const StringRange& aOther) const
 {
-  if (!mExact.size() || !aOther.mExact.size()) {
+  if (mExact.empty() || aOther.mExact.empty()) {
     return true;
   }
 
   ValueType intersection;
   set_intersection(mExact.begin(), mExact.end(),
                    aOther.mExact.begin(), aOther.mExact.end(),
                    std::inserter(intersection, intersection.begin()));
-  return !!intersection.size();
+  return !intersection.empty();
 }
 
 void
 NormalizedConstraintSet::StringRange::Intersect(const StringRange& aOther)
 {
-  if (!aOther.mExact.size()) {
+  if (aOther.mExact.empty()) {
     return;
   }
 
   ValueType intersection;
   set_intersection(mExact.begin(), mExact.end(),
                    aOther.mExact.begin(), aOther.mExact.end(),
                    std::inserter(intersection, intersection.begin()));
   mExact = intersection;
@@ -419,20 +419,20 @@ MediaConstraintsHelper::FitnessDistance(
 
 // Fitness distance returned as integer math * 1000. Infinity = UINT32_MAX
 
 /* static */ uint32_t
 MediaConstraintsHelper::FitnessDistance(
     nsString aN,
     const NormalizedConstraintSet::StringRange& aParams)
 {
-  if (aParams.mExact.size() && aParams.mExact.find(aN) == aParams.mExact.end()) {
+  if (!aParams.mExact.empty() && aParams.mExact.find(aN) == aParams.mExact.end()) {
     return UINT32_MAX;
   }
-  if (aParams.mIdeal.size() && aParams.mIdeal.find(aN) == aParams.mIdeal.end()) {
+  if (!aParams.mIdeal.empty() && aParams.mIdeal.find(aN) == aParams.mIdeal.end()) {
     return 1000;
   }
   return 0;
 }
 
 template<class MediaEngineSourceType>
 const char*
 MediaConstraintsHelper::FindBadConstraint(
--- a/dom/media/webrtc/MediaTrackConstraints.h
+++ b/dom/media/webrtc/MediaTrackConstraints.h
@@ -199,17 +199,17 @@ public:
       mIdeal.insert(aOther);
     }
 
     ~StringRange() {}
 
     void SetFrom(const dom::ConstrainDOMStringParameters& aOther);
     ValueType Clamp(const ValueType& n) const;
     ValueType Get(const ValueType& defaultValue) const {
-      return Clamp(mIdeal.size() ? mIdeal : defaultValue);
+      return Clamp(mIdeal.empty() ? defaultValue : mIdeal);
     }
     bool Intersects(const StringRange& aOther) const;
     void Intersect(const StringRange& aOther);
     bool Merge(const StringRange& aOther);
     void FinalizeMerge() override {}
   private:
     bool Merge(const BaseRange& aOther) override {
       return Merge(static_cast<const StringRange&>(aOther));
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -1931,17 +1931,17 @@ int NrTcpSocketIpc::write(const void *ms
 }
 
 int NrTcpSocketIpc::read(void* buf, size_t maxlen, size_t *len) {
   int _status = 0;
   if (state_ != NR_CONNECTED) {
     ABORT(R_FAILED);
   }
 
-  if (msg_queue_.size() == 0) {
+  if (msg_queue_.empty()) {
     ABORT(R_WOULDBLOCK);
   }
 
   {
     RefPtr<nr_tcp_message> msg(msg_queue_.front());
     size_t consumed_len = std::min(maxlen, msg->unread_bytes());
     memcpy(buf, msg->reading_pointer(), consumed_len);
     if (consumed_len < msg->unread_bytes()) {
@@ -2097,17 +2097,17 @@ void NrTcpSocketIpc::maybe_post_socket_r
       if (buffered_bytes_ < nsITCPSocketCallback::BUFFER_SIZE) {
         r_log(LOG_GENERIC, LOG_INFO, "Firing write callback (%u)",
               (uint32_t)buffered_bytes_);
         fire_callback(NR_ASYNC_WAIT_WRITE);
         has_event = true;
       }
     }
     if (poll_flags() & PR_POLL_READ) {
-      if (msg_queue_.size()) {
+      if (!msg_queue_.empty()) {
         if (msg_queue_.size() > 5) {
           r_log(LOG_GENERIC, LOG_INFO, "Firing read callback (%u)",
                 (uint32_t)msg_queue_.size());
         }
         fire_callback(NR_ASYNC_WAIT_READ);
         has_event = true;
       }
     }
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -1011,18 +1011,18 @@ std::vector<std::string> NrIceCtx::GetGl
 nsresult NrIceCtx::ParseGlobalAttributes(std::vector<std::string> attrs) {
   std::vector<char *> attrs_in;
 
   for (auto& attr : attrs) {
     attrs_in.push_back(const_cast<char *>(attr.c_str()));
   }
 
   int r = nr_ice_peer_ctx_parse_global_attributes(peer_,
-                                                  attrs_in.size() ?
-                                                  &attrs_in[0] : nullptr,
+                                                  attrs_in.empty() ?
+                                                  nullptr : &attrs_in[0],
                                                   attrs_in.size());
   if (r) {
     MOZ_MTLOG(ML_ERROR, "Couldn't parse global attributes for "
               << name_ << "'");
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -230,18 +230,18 @@ nsresult NrIceMediaStream::ParseAttribut
 
   for (auto& attribute : attributes) {
     attributes_in.push_back(const_cast<char *>(attribute.c_str()));
   }
 
   // Still need to call nr_ice_ctx_parse_stream_attributes.
   int r = nr_ice_peer_ctx_parse_stream_attributes(ctx_peer_,
                                                   stream_,
-                                                  attributes_in.size() ?
-                                                  &attributes_in[0] : nullptr,
+                                                  attributes_in.empty() ?
+                                                  nullptr : &attributes_in[0],
                                                   attributes_in.size());
   if (r) {
     MOZ_MTLOG(ML_ERROR, "Couldn't parse attributes for stream "
               << name_ << "'");
     return NS_ERROR_FAILURE;
   }
 
   has_parsed_attrs_ = true;
--- a/media/mtransport/test/test_nr_socket_ice_unittest.cpp
+++ b/media/mtransport/test/test_nr_socket_ice_unittest.cpp
@@ -189,35 +189,35 @@ public:
   void ParseGlobalAttributes(std::vector<std::string> attrs) {
     std::vector<char *> attrs_in;
 
     for (auto& attr : attrs) {
       attrs_in.push_back(const_cast<char *>(attr.c_str()));
     }
 
     int r = nr_ice_peer_ctx_parse_global_attributes(peer_ctx_,
-                                                    attrs_in.size() ?
-                                                    &attrs_in[0] : nullptr,
+                                                    attrs_in.empty() ?
+                                                    nullptr : &attrs_in[0],
                                                     attrs_in.size());
     ASSERT_EQ(0, r);
   }
 
   void SetControlling(bool controlling) {
     peer_ctx_->controlling = controlling ? 1 : 0;
   }
 
   void SetRemoteAttributes(std::vector<std::string> attributes) {
     int r;
 
     std::vector<char*> attrs;
     for (auto& attr: attributes) {
       attrs.push_back(const_cast<char*>(attr.c_str()));
     }
 
-    if (attrs.size()) {
+    if (!attrs.empty()) {
       r = nr_ice_peer_ctx_parse_stream_attributes(peer_ctx_, ice_media_stream_, &attrs[0], attrs.size());
       ASSERT_EQ(0, r);
     }
   }
 
   void StartChecks() {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this,
--- a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
+++ b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
@@ -1600,20 +1600,20 @@ TEST_P(JsepSessionTest, RenegotiationBot
   if (GetParam() == "datachannel") {
     return;
   }
 
   OfferAnswer();
 
   auto oHasStream = HasMediaStream(mSessionOff->GetLocalTracks());
   auto aHasStream = HasMediaStream(mSessionAns->GetLocalTracks());
-  ASSERT_EQ(oHasStream, GetLocalUniqueStreamIds(*mSessionOff).size() > 0);
-  ASSERT_EQ(aHasStream, GetLocalUniqueStreamIds(*mSessionAns).size() > 0);
-  ASSERT_EQ(aHasStream, GetRemoteUniqueStreamIds(*mSessionOff).size()> 0);
-  ASSERT_EQ(oHasStream, GetRemoteUniqueStreamIds(*mSessionAns).size() > 0);
+  ASSERT_EQ(oHasStream, !GetLocalUniqueStreamIds(*mSessionOff).empty());
+  ASSERT_EQ(aHasStream, !GetLocalUniqueStreamIds(*mSessionAns).empty());
+  ASSERT_EQ(aHasStream, !GetRemoteUniqueStreamIds(*mSessionOff).empty());
+  ASSERT_EQ(oHasStream, !GetRemoteUniqueStreamIds(*mSessionAns).empty());
 
   auto firstOffId = GetFirstLocalStreamId(*mSessionOff);
   auto firstAnsId = GetFirstLocalStreamId(*mSessionAns);
 
   auto offererPairs = GetTrackPairsByLevel(*mSessionOff);
   auto answererPairs = GetTrackPairsByLevel(*mSessionAns);
 
   std::vector<SdpMediaSection::MediaType> extraTypes;
@@ -1623,32 +1623,32 @@ TEST_P(JsepSessionTest, RenegotiationBot
   AddTracksToStream(*mSessionAns, firstAnsId, extraTypes);
   types.insert(types.end(), extraTypes.begin(), extraTypes.end());
 
   OfferAnswer(CHECK_SUCCESS);
 
   oHasStream = HasMediaStream(mSessionOff->GetLocalTracks());
   aHasStream = HasMediaStream(mSessionAns->GetLocalTracks());
 
-  ASSERT_EQ(oHasStream, GetLocalUniqueStreamIds(*mSessionOff).size() > 0);
-  ASSERT_EQ(aHasStream, GetLocalUniqueStreamIds(*mSessionAns).size() > 0);
-  ASSERT_EQ(aHasStream, GetRemoteUniqueStreamIds(*mSessionOff).size() > 0);
-  ASSERT_EQ(oHasStream, GetRemoteUniqueStreamIds(*mSessionAns).size() > 0);
+  ASSERT_EQ(oHasStream, !GetLocalUniqueStreamIds(*mSessionOff).empty());
+  ASSERT_EQ(aHasStream, !GetLocalUniqueStreamIds(*mSessionAns).empty());
+  ASSERT_EQ(aHasStream, !GetRemoteUniqueStreamIds(*mSessionOff).empty());
+  ASSERT_EQ(oHasStream, !GetRemoteUniqueStreamIds(*mSessionAns).empty());
   if (oHasStream) {
     ASSERT_STREQ(firstOffId.c_str(),
                  GetFirstLocalStreamId(*mSessionOff).c_str());
   }
   if (aHasStream) {
     ASSERT_STREQ(firstAnsId.c_str(),
                  GetFirstLocalStreamId(*mSessionAns).c_str());
 
   auto oHasStream = HasMediaStream(mSessionOff->GetLocalTracks());
   auto aHasStream = HasMediaStream(mSessionAns->GetLocalTracks());
-  ASSERT_EQ(oHasStream, GetLocalUniqueStreamIds(*mSessionOff).size() > 0);
-  ASSERT_EQ(aHasStream, GetLocalUniqueStreamIds(*mSessionAns).size() > 0);
+  ASSERT_EQ(oHasStream, !GetLocalUniqueStreamIds(*mSessionOff).empty());
+  ASSERT_EQ(aHasStream, !GetLocalUniqueStreamIds(*mSessionAns).empty());
   }
 }
 
 TEST_P(JsepSessionTest, RenegotiationOffererRemovesTrack)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
   if (types.front() == SdpMediaSection::kApplication) {
--- a/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
@@ -305,17 +305,17 @@ class TestAgent {
     uint32_t res = 0;
     audio_conduit_->GetRemoteSSRC(&res);
     return res;
   }
 
   uint32_t GetLocalSSRC() {
     std::vector<uint32_t> res;
     res = audio_conduit_->GetLocalSSRCs();
-    return res.size() > 0 ? res[0] : 0;
+    return res.empty() ? 0 : res[0];
   }
 
   int GetAudioRtpCountSent() {
     return audio_pipeline_->rtp_packets_sent();
   }
 
   int GetAudioRtpCountReceived() {
     return audio_pipeline_->rtp_packets_received();
--- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
+++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
@@ -320,17 +320,17 @@ class JsepVideoCodecDescription : public
       }
 
       // Parameters that apply to both the send and recv directions
       h264Params.packetization_mode = mPacketizationMode;
       // Hard-coded, may need to change someday?
       h264Params.level_asymmetry_allowed = true;
 
       msection.SetFmtp(SdpFmtpAttributeList::Fmtp(mDefaultPt, h264Params));
-    } else if (mName == "red" && mRedundantEncodings.size()) {
+    } else if (mName == "red" && !mRedundantEncodings.empty()) {
       SdpFmtpAttributeList::RedParameters redParams(
           GetRedParameters(mDefaultPt, msection));
       redParams.encodings = mRedundantEncodings;
       msection.SetFmtp(SdpFmtpAttributeList::Fmtp(mDefaultPt, redParams));
     } else if (mName == "VP8" || mName == "VP9") {
       if (mDirection == sdp::kRecv) {
         // VP8 and VP9 share the same SDP parameters thus far
         SdpFmtpAttributeList::VP8Parameters vp8Params(
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -122,17 +122,17 @@ JsepSessionImpl::AddTrack(const RefPtr<J
   if (track->GetMediaType() != SdpMediaSection::kApplication) {
     track->SetCNAME(mCNAME);
     // Establish minimum number of required SSRCs
     // Note that AddTrack is only for send direction
     size_t minimumSsrcCount = 0;
     std::vector<JsepTrack::JsConstraints> constraints;
     track->GetJsConstraints(&constraints);
     for (auto constraint : constraints) {
-      if (constraint.rid != "") {
+      if (!constraint.rid.empty()) {
         minimumSsrcCount++;
       }
     }
     // We need at least 1 SSRC
     minimumSsrcCount = std::max<size_t>(1, minimumSsrcCount);
     size_t currSsrcCount = track->GetSsrcs().size();
     if (currSsrcCount < minimumSsrcCount ) {
       MOZ_MTLOG(ML_DEBUG,
@@ -306,17 +306,17 @@ JsepSessionImpl::SetParameters(const std
     return NS_ERROR_INVALID_ARG;
   }
 
   // Add RtpStreamId Extmap
   // SdpDirectionAttribute::Direction is a bitmask
   SdpDirectionAttribute::Direction addVideoExt = SdpDirectionAttribute::kInactive;
   SdpDirectionAttribute::Direction addAudioExt = SdpDirectionAttribute::kInactive;
   for (auto constraintEntry: constraints) {
-    if (constraintEntry.rid != "") {
+    if (!constraintEntry.rid.empty()) {
       switch (it->mTrack->GetMediaType()) {
         case SdpMediaSection::kVideo: {
           addVideoExt = static_cast<SdpDirectionAttribute::Direction>(addVideoExt
                                                                       | it->mTrack->GetDirection());
           break;
         }
         case SdpMediaSection::kAudio: {
           addAudioExt = static_cast<SdpDirectionAttribute::Direction>(addAudioExt
@@ -339,17 +339,17 @@ JsepSessionImpl::SetParameters(const std
   auto track = it->mTrack;
   if (track->GetDirection() == sdp::kSend) {
     // Establish minimum number of required SSRCs
     // Note that AddTrack is only for send direction
     size_t minimumSsrcCount = 0;
     std::vector<JsepTrack::JsConstraints> constraints;
     track->GetJsConstraints(&constraints);
     for (auto constraint : constraints) {
-      if (constraint.rid != "") {
+      if (!constraint.rid.empty()) {
         minimumSsrcCount++;
       }
     }
     // We need at least 1 SSRC
     minimumSsrcCount = std::max<size_t>(1, minimumSsrcCount);
     size_t currSsrcCount = track->GetSsrcs().size();
     if (currSsrcCount < minimumSsrcCount ) {
       MOZ_MTLOG(ML_DEBUG,
@@ -668,17 +668,17 @@ JsepSessionImpl::SetupBundle(Sdp* sdp) c
         // Set port to 0 for sections with bundle-only attribute. (mjf)
         sdp->GetMediaSection(i).SetPort(0);
       }
 
       mids.push_back(attrs.GetMid());
     }
   }
 
-  if (mids.size() >= 1) {
+  if (!mids.empty()) {
     UniquePtr<SdpGroupAttributeList> groupAttr(new SdpGroupAttributeList);
     groupAttr->PushEntry(SdpGroupAttributeList::kBundle, mids);
     sdp->GetAttributeList().SetAttribute(groupAttr.release());
   }
 }
 
 nsresult
 JsepSessionImpl::GetRemoteIds(const Sdp& sdp,
--- a/media/webrtc/signaling/src/jsep/JsepTrack.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepTrack.cpp
@@ -272,17 +272,17 @@ JsepTrack::CreateEncodings(
   if (rids.empty()) {
     // Add dummy value with an empty id to make sure we get a single unicast
     // stream.
     rids.push_back(SdpRidAttributeList::Rid());
   }
 
   size_t max_streams = 1;
 
-  if (mJsEncodeConstraints.size()) {
+  if (!mJsEncodeConstraints.empty()) {
     max_streams = std::min(rids.size(), mJsEncodeConstraints.size());
   }
   // Drop SSRCs if less RIDs were offered than we have encoding constraints
   if (mSsrcs.size() > max_streams) {
     mSsrcs.resize(max_streams);
   }
 
   // For each stream make sure we have an encoding, and configure
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -992,18 +992,18 @@ bool WebrtcVideoConduit::GetRTCPReceiver
 {
   {
     CSFLogVerbose(logTag, "%s for VideoConduit:%p", __FUNCTION__, this);
     MutexAutoLock lock(mCodecMutex);
     if (!mSendStream) {
       return false;
     }
     const webrtc::VideoSendStream::Stats& sendStats = mSendStream->GetStats();
-    if (sendStats.substreams.size() == 0
-        || mSendStreamConfig.rtp.ssrcs.size() == 0) {
+    if (sendStats.substreams.empty()
+        || mSendStreamConfig.rtp.ssrcs.empty()) {
       return false;
     }
     uint32_t ssrc = mSendStreamConfig.rtp.ssrcs.front();
     auto ind = sendStats.substreams.find(ssrc);
     if (ind == sendStats.substreams.end()) {
       CSFLogError(logTag,
         "%s for VideoConduit:%p ssrc not found in SendStream stats.",
         __FUNCTION__, this);
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipelineFilter.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipelineFilter.cpp
@@ -31,17 +31,17 @@ bool MediaPipelineFilter::Filter(const w
     }
     // Some other stream; it is possible that an SSRC has moved, so make sure
     // we don't have that SSRC in our filter any more.
     remote_ssrc_set_.erase(header.ssrc);
     return false;
   }
 
   if (!header.extension.rtpStreamId.empty() &&
-      remote_rid_set_.size() &&
+      !remote_rid_set_.empty() &&
       remote_rid_set_.count(header.extension.rtpStreamId.data())) {
     return true;
   }
   if (!header.extension.rtpStreamId.empty()) {
     MOZ_MTLOG(ML_DEBUG, "MediaPipelineFilter ignoring seq# " << header.sequenceNumber <<
               " ssrc: " << header.ssrc << " RID: " << header.extension.rtpStreamId.data());
   }
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -401,17 +401,17 @@ nsresult PeerConnectionMedia::Init(const
   }
   // Give us a way to globally turn off TURN support
   bool disabled = Preferences::GetBool("media.peerconnection.turn.disable", false);
   if (!disabled) {
     if (NS_FAILED(rv = mIceCtxHdlr->ctx()->SetTurnServers(turn_servers))) {
       CSFLogError(logTag, "%s: Failed to set turn servers", __FUNCTION__);
       return rv;
     }
-  } else if (turn_servers.size() != 0) {
+  } else if (!turn_servers.empty()) {
     CSFLogError(logTag, "%s: Setting turn servers disabled", __FUNCTION__);
   }
   if (NS_FAILED(rv = mDNSResolver->Init())) {
     CSFLogError(logTag, "%s: Failed to initialize dns resolver", __FUNCTION__);
     return rv;
   }
   if (NS_FAILED(rv =
       mIceCtxHdlr->ctx()->SetResolver(mDNSResolver->AllocateResolver()))) {
--- a/media/webrtc/signaling/src/sdp/SdpAttribute.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpAttribute.cpp
@@ -239,17 +239,17 @@ class SkipFirstDelimiter
 static std::ostream& operator<<(std::ostream& os, SkipFirstDelimiter& delim)
 {
   return delim.print(os);
 }
 
 void
 SdpImageattrAttributeList::XYRange::Serialize(std::ostream& os) const
 {
-  if (discreteValues.size() == 0) {
+  if (discreteValues.empty()) {
     os << "[" << min << ":";
     if (step != 1) {
       os << step << ":";
     }
     os << max << "]";
   } else if (discreteValues.size() == 1) {
     os << discreteValues.front();
   } else {
@@ -495,17 +495,17 @@ SdpImageattrAttributeList::PRange::Parse
   }
   return true;
 }
 
 void
 SdpImageattrAttributeList::SRange::Serialize(std::ostream& os) const
 {
   os << std::setprecision(4) << std::fixed;
-  if (discreteValues.size() == 0) {
+  if (discreteValues.empty()) {
     os << "[" << min << "-" << max << "]";
   } else if (discreteValues.size() == 1) {
     os << discreteValues.front();
   } else {
     os << "[";
     SkipFirstDelimiter comma(",");
     for (auto value : discreteValues) {
       os << comma << value;
--- a/media/webrtc/signaling/src/sdp/SdpHelper.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpHelper.cpp
@@ -46,17 +46,17 @@ SdpHelper::CopyTransportParams(size_t nu
     for (const std::string& candidate : oldLocalAttrs.GetCandidate()) {
       size_t component;
       nsresult rv = GetComponent(candidate, &component);
       NS_ENSURE_SUCCESS(rv, rv);
       if (numComponents >= component) {
         candidateAttrs->mValues.push_back(candidate);
       }
     }
-    if (candidateAttrs->mValues.size()) {
+    if (!candidateAttrs->mValues.empty()) {
       newLocalAttrs.SetAttribute(candidateAttrs.release());
     }
   }
 
   if (numComponents == 2 &&
       oldLocalAttrs.HasAttribute(SdpAttribute::kRtcpAttribute)) {
     // copy rtcp attribute if we had one that we are using
     newLocalAttrs.SetAttribute(new SdpRtcpAttribute(oldLocalAttrs.GetRtcp()));
--- a/media/webrtc/signaling/src/sdp/SdpMediaSection.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpMediaSection.cpp
@@ -87,17 +87,17 @@ const SdpSctpmapAttributeList::Sctpmap*
 SdpMediaSection::GetSctpmap() const
 {
   auto& attrs = GetAttributeList();
   if (!attrs.HasAttribute(SdpAttribute::kSctpmapAttribute)) {
     return nullptr;
   }
 
   const SdpSctpmapAttributeList& sctpmap = attrs.GetSctpmap();
-  if (!sctpmap.mSctpmaps.size()) {
+  if (sctpmap.mSctpmaps.empty()) {
     return nullptr;
   }
 
   return &sctpmap.GetFirstEntry();
 }
 
 uint32_t
 SdpMediaSection::GetSctpPort() const
--- a/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.cpp
+++ b/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.cpp
@@ -266,17 +266,17 @@ SipccSdpAttributeList::LoadFingerprint(s
                                 "Only one token in fingerprint attribute");
       return false;
     }
 
     std::string fingerprintToken(fingerprintAttr.substr(start));
 
     std::vector<uint8_t> fingerprint =
         SdpFingerprintAttributeList::ParseFingerprint(fingerprintToken);
-    if (fingerprint.size() == 0) {
+    if (fingerprint.empty()) {
       errorHolder.AddParseError(lineNumber, "Malformed fingerprint token");
       return false;
     }
 
     if (!fingerprintAttrs) {
       fingerprintAttrs.reset(new SdpFingerprintAttributeList);
     }