Browse Source

Reserve space for vector

adaptive-webui-19844
Chocobo1 3 years ago
parent
commit
45e31a153c
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 3
      src/base/bittorrent/torrentimpl.cpp

3
src/base/bittorrent/torrentimpl.cpp

@ -797,7 +797,8 @@ QVector<DownloadPriority> TorrentImpl::filePriorities() const @@ -797,7 +797,8 @@ QVector<DownloadPriority> TorrentImpl::filePriorities() const
const std::vector<lt::download_priority_t> fp = m_nativeHandle.get_file_priorities();
QVector<DownloadPriority> ret;
std::transform(fp.cbegin(), fp.cend(), std::back_inserter(ret), [](lt::download_priority_t priority)
ret.reserve(fp.size());
std::transform(fp.cbegin(), fp.cend(), std::back_inserter(ret), [](const lt::download_priority_t priority)
{
return static_cast<DownloadPriority>(toLTUnderlyingType(priority));
});

Loading…
Cancel
Save