提交 76edda1d authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

C++ cosmetic changes (use auto when possible)

上级 25646e92
......@@ -603,7 +603,7 @@ namespace RTC
retransmitted);
#endif
float repairedRatio = static_cast<float>(repaired) / static_cast<float>(received);
auto repairedRatio = static_cast<float>(repaired) / static_cast<float>(received);
auto repairedWeight = std::pow(1 / (repairedRatio + 1), 4);
MS_ASSERT(retransmitted >= repaired, "repaired packets cannot be more than retransmitted ones");
......@@ -613,8 +613,8 @@ namespace RTC
lost -= repaired * repairedWeight;
float deliveredRatio = static_cast<float>(received - lost) / static_cast<float>(received);
auto score = std::round(std::pow(deliveredRatio, 4) * 10);
auto deliveredRatio = static_cast<float>(received - lost) / static_cast<float>(received);
auto score = static_cast<uint8_t>(std::round(std::pow(deliveredRatio, 4) * 10));
#ifdef MS_LOG_DEV
MS_DEBUG_TAG(
......
......@@ -656,7 +656,7 @@ namespace RTC
retransmitted);
#endif
float repairedRatio = static_cast<float>(repaired) / static_cast<float>(sent);
auto repairedRatio = static_cast<float>(repaired) / static_cast<float>(sent);
auto repairedWeight = std::pow(1 / (repairedRatio + 1), 4);
MS_ASSERT(retransmitted >= repaired, "repaired packets cannot be more than retransmitted ones");
......@@ -666,8 +666,8 @@ namespace RTC
lost -= repaired * repairedWeight;
float deliveredRatio = static_cast<float>(sent - lost) / static_cast<float>(sent);
auto score = std::round(std::pow(deliveredRatio, 4) * 10);
auto deliveredRatio = static_cast<float>(sent - lost) / static_cast<float>(sent);
auto score = static_cast<uint8_t>(std::round(std::pow(deliveredRatio, 4) * 10));
#ifdef MS_LOG_DEV
MS_DEBUG_TAG(
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论