mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Avoid heavy weight function object
Also, by switching to template we can avoid the cost of converting to some specific type and perfectly forward the parameter to the final function. PR #21572.
This commit is contained in:
parent
ac646f47a2
commit
21b0367629
4 changed files with 10 additions and 11 deletions
|
@ -71,7 +71,6 @@
|
|||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
#include <QThread>
|
||||
#include <QThreadPool>
|
||||
#include <QTimer>
|
||||
#include <QUuid>
|
||||
|
||||
|
@ -3013,11 +3012,6 @@ void SessionImpl::removeMappedPorts(const QSet<quint16> &ports)
|
|||
});
|
||||
}
|
||||
|
||||
void SessionImpl::invokeAsync(std::function<void ()> func)
|
||||
{
|
||||
m_asyncWorker->start(std::move(func));
|
||||
}
|
||||
|
||||
// Add a torrent to libtorrent session in hidden mode
|
||||
// and force it to download its metadata
|
||||
bool SessionImpl::downloadMetadata(const TorrentDescriptor &torrentDescr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue