mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Reserve space for vector
This commit is contained in:
parent
7c23d800e6
commit
45e31a153c
@ -797,7 +797,8 @@ QVector<DownloadPriority> TorrentImpl::filePriorities() const
|
|||||||
const std::vector<lt::download_priority_t> fp = m_nativeHandle.get_file_priorities();
|
const std::vector<lt::download_priority_t> fp = m_nativeHandle.get_file_priorities();
|
||||||
|
|
||||||
QVector<DownloadPriority> ret;
|
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));
|
return static_cast<DownloadPriority>(toLTUnderlyingType(priority));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user