提交 323930ca authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Remove ununsed variable and use references.

上级 62adee13
...@@ -38,7 +38,7 @@ tap.test('room.Peer() without peerName must fail', { timeout: 2000 }, (t) => ...@@ -38,7 +38,7 @@ tap.test('room.Peer() without peerName must fail', { timeout: 2000 }, (t) =>
room.Peer(); room.Peer();
}, },
TypeError, TypeError,
'room.Peer()) must throw TypeError'); 'room.Peer() must throw TypeError');
t.end(); t.end();
}); });
......
...@@ -204,20 +204,18 @@ namespace RTC ...@@ -204,20 +204,18 @@ namespace RTC
void RtpParameters::ValidateEncodings() void RtpParameters::ValidateEncodings()
{ {
uint8_t firstMediaPayloadType; uint8_t firstMediaPayloadType;
bool hasFirstMediaPayloadType = false;
{ {
auto it = this->codecs.begin(); auto it = this->codecs.begin();
for (; it != this->codecs.end(); ++it) for (; it != this->codecs.end(); ++it)
{ {
auto codec = *it; auto& codec = *it;
// Must be a media codec. // Must be a media codec.
if (codec.mime.IsMediaCodec()) if (codec.mime.IsMediaCodec())
{ {
firstMediaPayloadType = codec.payloadType; firstMediaPayloadType = codec.payloadType;
hasFirstMediaPayloadType = true;
break; break;
} }
...@@ -239,7 +237,7 @@ namespace RTC ...@@ -239,7 +237,7 @@ namespace RTC
this->encodings.push_back(encoding); this->encodings.push_back(encoding);
} }
// Otherwise iterate all the encodings, set the first payloadType in all of them // Otherwise iterate all the encodings, set the first payloadType in all of them
// with codecPayloadType unset, and check that others point to a media codec. // with `codecPayloadType` unset, and check that others point to a media codec.
else else
{ {
for (auto& encoding : this->encodings) for (auto& encoding : this->encodings)
......
...@@ -196,7 +196,7 @@ namespace RTC ...@@ -196,7 +196,7 @@ namespace RTC
for (; it != rtpParameters->encodings.end(); ++it) for (; it != rtpParameters->encodings.end(); ++it)
{ {
auto encoding = *it; auto& encoding = *it;
if ( if (
!encoding.ssrc || !encoding.ssrc ||
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论