fixed bug in stat patch
This commit is contained in:
parent
6387910a42
commit
786af218e1
|
@ -41,9 +41,11 @@ namespace libtorrent {
|
||||||
|
|
||||||
void stat_channel::second_tick(int tick_interval_ms)
|
void stat_channel::second_tick(int tick_interval_ms)
|
||||||
{
|
{
|
||||||
|
if (m_counter == 0) return;
|
||||||
|
|
||||||
int sample = int(size_type(m_counter) * 1000 / tick_interval_ms);
|
int sample = int(size_type(m_counter) * 1000 / tick_interval_ms);
|
||||||
TORRENT_ASSERT(sample >= 0);
|
TORRENT_ASSERT(sample >= 0);
|
||||||
m_average = m_average * 4 / 3 + sample / 4;
|
m_average = m_average * 3 / 4 + sample / 4;
|
||||||
m_counter = 0;
|
m_counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue