提交 b10a9ba3 authored 作者: José Luis Millán's avatar José Luis Millán

Worker format: avoid large conditional blocks

上级 d42d6f1f
...@@ -110,8 +110,11 @@ namespace RTC ...@@ -110,8 +110,11 @@ namespace RTC
Json::Value json(Json::arrayValue); Json::Value json(Json::arrayValue);
if (this->rtpStream != nullptr) if (this->rtpStream == nullptr)
{ {
return json;
}
auto jsonRtpStream = this->rtpStream->GetStats(); auto jsonRtpStream = this->rtpStream->GetStats();
if (this->transport != nullptr) if (this->transport != nullptr)
...@@ -119,8 +122,13 @@ namespace RTC ...@@ -119,8 +122,13 @@ namespace RTC
jsonRtpStream[JsonStringTransportId] = this->transport->transportId; jsonRtpStream[JsonStringTransportId] = this->transport->transportId;
} }
if (this->effectiveProfile != RTC::RtpEncodingParameters::Profile::NONE) if (this->effectiveProfile == RTC::RtpEncodingParameters::Profile::NONE)
{ {
json.append(jsonRtpStream);
return json;
}
auto it = this->mapProfileRtpStream.find(this->effectiveProfile); auto it = this->mapProfileRtpStream.find(this->effectiveProfile);
MS_ASSERT( MS_ASSERT(
...@@ -132,10 +140,8 @@ namespace RTC ...@@ -132,10 +140,8 @@ namespace RTC
jsonRtpStream[JsonStringInboundRtpId] = inboundRtpStream->GetId(); jsonRtpStream[JsonStringInboundRtpId] = inboundRtpStream->GetId();
json.append(jsonInboundRtpStream); json.append(jsonInboundRtpStream);
}
json.append(jsonRtpStream); json.append(jsonRtpStream);
}
return json; return json;
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论