last dests list forming edited

This commit is contained in:
acetone
2022-11-25 15:20:41 +03:00
parent e7408fa931
commit dbf7267f79
+7 -2
View File
@@ -51,14 +51,19 @@ void Statistics::report(const LogEvent& event)
}
m_lastDestinationsMtx.lock();
if (not m_lastDestinations.contains(event.dest))
int index = m_lastDestinations.indexOf(event.dest);
if (index == -1)
{
if (m_lastDestinations.size() == 5)
{
m_lastDestinations.pop_back();
}
m_lastDestinations.push_front(event.dest);
}
else
{
m_lastDestinations.removeAt(index);
}
m_lastDestinations.push_front(event.dest);
m_lastDestinationsMtx.unlock();
if (g::p::IGNORE_IP_ADDRS_IN_STATISTCS and isIpAddress(event.dest))