mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 05:27:15 +03:00
Avoid unecessary copying the parameter
Using forwarding reference here so that we won't get unnecessary copies of the parameter passed to `slot`, for example a lambda function.
This commit is contained in:
parent
aeabd2d625
commit
0891cd4878
1 changed files with 2 additions and 2 deletions
|
@ -119,7 +119,7 @@ namespace Net
|
|||
static DownloadManager *instance();
|
||||
|
||||
template <typename Context, typename Func>
|
||||
void download(const DownloadRequest &downloadRequest, Context context, Func slot);
|
||||
void download(const DownloadRequest &downloadRequest, Context context, Func &&slot);
|
||||
|
||||
void registerSequentialService(const ServiceID &serviceID);
|
||||
|
||||
|
@ -150,7 +150,7 @@ namespace Net
|
|||
};
|
||||
|
||||
template <typename Context, typename Func>
|
||||
void DownloadManager::download(const DownloadRequest &downloadRequest, Context context, Func slot)
|
||||
void DownloadManager::download(const DownloadRequest &downloadRequest, Context context, Func &&slot)
|
||||
{
|
||||
const DownloadHandler *handler = download(downloadRequest);
|
||||
connect(handler, &DownloadHandler::finished, context, slot);
|
||||
|
|
Loading…
Reference in a new issue