mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Use library provided erase_if()
`Algorithm::removeIf()` is still valuable as `QHash::removeIf()` predicate require an iterator or a `std::pair`, which both require more code to unpack the variable and therefore cumbersome to use. PR #19353.
This commit is contained in:
@@ -148,7 +148,7 @@ void Server::removeConnection(Connection *connection)
|
||||
|
||||
void Server::dropTimedOutConnection()
|
||||
{
|
||||
Algorithm::removeIf(m_connections, [](Connection *connection)
|
||||
erase_if(m_connections, [](Connection *connection)
|
||||
{
|
||||
if (!connection->hasExpired(KEEP_ALIVE_DURATION))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user