提交 0b643a4a authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

C++: add brackets in conditions (more)

上级 2584ae44
...@@ -48,7 +48,9 @@ namespace RTC ...@@ -48,7 +48,9 @@ namespace RTC
new FeedbackRtpTransportPacket(commonHeader, len)); new FeedbackRtpTransportPacket(commonHeader, len));
if (!packet->IsCorrect()) if (!packet->IsCorrect())
{
return nullptr; return nullptr;
}
return packet.release(); return packet.release();
} }
...@@ -399,7 +401,9 @@ namespace RTC ...@@ -399,7 +401,9 @@ namespace RTC
auto& packetResult = packetResults[idx]; auto& packetResult = packetResults[idx];
if (!packetResult.received) if (!packetResult.received)
{
continue; continue;
}
currentReceivedAtMs += this->deltas.at(deltaIdx) / 4; currentReceivedAtMs += this->deltas.at(deltaIdx) / 4;
packetResult.delta = this->deltas.at(deltaIdx); packetResult.delta = this->deltas.at(deltaIdx);
...@@ -418,7 +422,9 @@ namespace RTC ...@@ -418,7 +422,9 @@ namespace RTC
uint16_t lost{ 0u }; uint16_t lost{ 0u };
if (expected == 0u) if (expected == 0u)
{
return 0u; return 0u;
}
for (auto* chunk : this->chunks) for (auto* chunk : this->chunks)
{ {
...@@ -428,7 +434,9 @@ namespace RTC ...@@ -428,7 +434,9 @@ namespace RTC
// NOTE: If lost equals expected, the math below would produce 256, which // NOTE: If lost equals expected, the math below would produce 256, which
// becomes 0 in uint8_t. // becomes 0 in uint8_t.
if (lost == expected) if (lost == expected)
{
return 255u; return 255u;
}
return (lost << 8) / expected; return (lost << 8) / expected;
} }
...@@ -487,9 +495,13 @@ namespace RTC ...@@ -487,9 +495,13 @@ namespace RTC
Status status; Status status;
if (delta >= 0 && delta <= 255) if (delta >= 0 && delta <= 255)
{
status = Status::SmallDelta; status = Status::SmallDelta;
}
else else
{
status = Status::LargeDelta; status = Status::LargeDelta;
}
// Create a long run chunk before processing this packet, if needed. // Create a long run chunk before processing this packet, if needed.
// clang-format off // clang-format off
...@@ -576,7 +588,9 @@ namespace RTC ...@@ -576,7 +588,9 @@ namespace RTC
{ {
// No pending status packets. // No pending status packets.
if (this->context.statuses.empty()) if (this->context.statuses.empty())
{
return; return;
}
if (this->context.allSameStatus) if (this->context.allSameStatus)
{ {
...@@ -638,9 +652,13 @@ namespace RTC ...@@ -638,9 +652,13 @@ namespace RTC
uint8_t symbolSize = data[0] & 0x40; uint8_t symbolSize = data[0] & 0x40;
if (symbolSize == 0) if (symbolSize == 0)
{
return new OneBitVectorChunk(bytes, count); return new OneBitVectorChunk(bytes, count);
}
else else
{
return new TwoBitVectorChunk(bytes, count); return new TwoBitVectorChunk(bytes, count);
}
} }
return nullptr; return nullptr;
...@@ -717,9 +735,13 @@ namespace RTC ...@@ -717,9 +735,13 @@ namespace RTC
MS_TRACE(); MS_TRACE();
if (this->status == Status::SmallDelta || this->status == Status::LargeDelta) if (this->status == Status::SmallDelta || this->status == Status::LargeDelta)
{
return this->count; return this->count;
}
else else
{
return 0u; return 0u;
}
} }
void FeedbackRtpTransportPacket::RunLengthChunk::FillResults( void FeedbackRtpTransportPacket::RunLengthChunk::FillResults(
...@@ -837,7 +859,9 @@ namespace RTC ...@@ -837,7 +859,9 @@ namespace RTC
for (auto status : this->statuses) for (auto status : this->statuses)
{ {
if (status == Status::SmallDelta || status == Status::LargeDelta) if (status == Status::SmallDelta || status == Status::LargeDelta)
{
count++; count++;
}
} }
return count; return count;
...@@ -975,7 +999,9 @@ namespace RTC ...@@ -975,7 +999,9 @@ namespace RTC
for (auto status : this->statuses) for (auto status : this->statuses)
{ {
if (status == Status::SmallDelta || status == Status::LargeDelta) if (status == Status::SmallDelta || status == Status::LargeDelta)
{
count++; count++;
}
} }
return count; return count;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论