Merge pull request #11422 from Chocobo1/buffer

Reserve memory for file data buffers
This commit is contained in:
Mike Tzou
2019-11-02 13:16:21 +08:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

@@ -3560,6 +3560,7 @@ void Session::handleTorrentResumeDataReady(TorrentHandle *const torrent, const l
// isn't cheap too.
QByteArray out;
out.reserve(1024 * 1024); // most fastresume file sizes are under 1 MB
lt::bencode(std::back_inserter(out), data);
const QString filename = QString("%1.fastresume").arg(torrent->hash());