Browse Source

Use move construct for shared pointers

adaptive-webui-19844
Chocobo1 1 year ago
parent
commit
8655e48336
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/base/bittorrent/customstorage.cpp
  2. 2
      src/base/bittorrent/sessionimpl.cpp
  3. 2
      src/base/digest32.h

2
src/base/bittorrent/customstorage.cpp

@ -92,7 +92,7 @@ bool CustomDiskIOThread::async_write(lt::storage_index_t storage, const lt::peer
, const char *buf, std::shared_ptr<lt::disk_observer> diskObserver , const char *buf, std::shared_ptr<lt::disk_observer> diskObserver
, std::function<void (const lt::storage_error &)> handler, lt::disk_job_flags_t flags) , std::function<void (const lt::storage_error &)> handler, lt::disk_job_flags_t flags)
{ {
return m_nativeDiskIO->async_write(storage, peerRequest, buf, diskObserver, std::move(handler), flags); return m_nativeDiskIO->async_write(storage, peerRequest, buf, std::move(diskObserver), std::move(handler), flags);
} }
void CustomDiskIOThread::async_hash(lt::storage_index_t storage, lt::piece_index_t piece void CustomDiskIOThread::async_hash(lt::storage_index_t storage, lt::piece_index_t piece

2
src/base/bittorrent/sessionimpl.cpp

@ -1318,7 +1318,7 @@ void SessionImpl::processNextResumeData(ResumeSessionContext *context)
std::shared_ptr<lt::torrent_info> ti = resumeData.ltAddTorrentParams.ti; std::shared_ptr<lt::torrent_info> ti = resumeData.ltAddTorrentParams.ti;
resumeData = *loadPreferredResumeDataResult; resumeData = *loadPreferredResumeDataResult;
if (!resumeData.ltAddTorrentParams.ti) if (!resumeData.ltAddTorrentParams.ti)
resumeData.ltAddTorrentParams.ti = ti; resumeData.ltAddTorrentParams.ti = std::move(ti);
} }
} }
} }

2
src/base/digest32.h

@ -84,7 +84,7 @@ private:
class Data; class Data;
explicit Digest32(QSharedDataPointer<Data> dataPtr) explicit Digest32(QSharedDataPointer<Data> dataPtr)
: m_dataPtr {dataPtr} : m_dataPtr {std::move(dataPtr)}
{ {
} }

Loading…
Cancel
Save