mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
Fix startup performance on Qt5
Use more appropriate container (QList) for resume data queue buffer. QVector in Qt5 has poor performance of the first element taking operation, which is used to process the resume data queue. In Qt6, QVector is just an alias for QList, so there was no problem there. PR #18387. Fixes #18341.
This commit is contained in:
committed by
GitHub
parent
719e4afd8c
commit
2b20d5b260
@@ -33,6 +33,7 @@
|
||||
#include <QMetaObject>
|
||||
#include <QMutexLocker>
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
|
||||
const int TORRENTIDLIST_TYPEID = qRegisterMetaType<QVector<BitTorrent::TorrentID>>();
|
||||
|
||||
@@ -59,11 +60,11 @@ void BitTorrent::ResumeDataStorage::loadAll() const
|
||||
loadingThread->start();
|
||||
}
|
||||
|
||||
QVector<BitTorrent::LoadedResumeData> BitTorrent::ResumeDataStorage::fetchLoadedResumeData() const
|
||||
QList<BitTorrent::LoadedResumeData> BitTorrent::ResumeDataStorage::fetchLoadedResumeData() const
|
||||
{
|
||||
const QMutexLocker locker {&m_loadedResumeDataMutex};
|
||||
|
||||
const QVector<BitTorrent::LoadedResumeData> loadedResumeData = m_loadedResumeData;
|
||||
const QList<BitTorrent::LoadedResumeData> loadedResumeData = m_loadedResumeData;
|
||||
m_loadedResumeData.clear();
|
||||
|
||||
return loadedResumeData;
|
||||
|
||||
Reference in New Issue
Block a user