Merge pull request #17980 from Chocobo1/model

Reserve space before appending elements
This commit is contained in:
Chocobo1 2022-11-10 17:24:17 +08:00 committed by GitHub
commit d328eeb5be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 21 deletions

View file

@ -2908,10 +2908,8 @@ void SessionImpl::generateResumeData()
void SessionImpl::saveResumeData()
{
for (const TorrentImpl *torrent : asConst(m_torrents))
{
torrent->nativeHandle().save_resume_data(lt::torrent_handle::only_if_modified);
++m_numResumeData;
}
m_numResumeData += m_torrents.size();
// clear queued storage move jobs except the current ongoing one
if (m_moveStorageQueue.size() > 1)