diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 3b86e8ee1..a697bb30e 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -797,7 +797,8 @@ QVector TorrentImpl::filePriorities() const const std::vector fp = m_nativeHandle.get_file_priorities(); QVector 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(toLTUnderlyingType(priority)); });