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
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)

View File

@@ -124,7 +124,7 @@ namespace
// Spoof HTTP Referer to allow adding torrent link from Torcache/KickAssTorrents
request.setRawHeader("Referer", request.url().toEncoded().data());
#ifdef QT_NO_COMPRESS
// The macro "QT_NO_COMPRESS" defined in QT will disable the zlib releated features
// The macro "QT_NO_COMPRESS" defined in QT will disable the zlib related features
// and reply data auto-decompression in QT will also be disabled. But we can support
// gzip encoding and manually decompress the reply data.
request.setRawHeader("Accept-Encoding", "gzip");