MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / StatisticalValueFromTL

Function StatisticalValueFromTL

Telegram/SourceFiles/api/api_statistics.cpp:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace {
24
25[[nodiscard]] Data::StatisticalValue StatisticalValueFromTL(
26 const MTPStatsAbsValueAndPrev &tl) {
27 const auto current = tl.data().vcurrent().v;
28 const auto previous = tl.data().vprevious().v;
29 return Data::StatisticalValue{
30 .value = current,
31 .previousValue = previous,
32 .growthRatePercentage = previous
33 ? std::abs((current - previous) / float64(previous) * 100.)
34 : 0,
35 };
36}
37
38[[nodiscard]] Data::ChannelStatistics ChannelStatisticsFromTL(
39 const MTPDstats_broadcastStats &data) {

Callers 2

ChannelStatisticsFromTLFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected