mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Replace QMap with QHash when sensible
This commit is contained in:
parent
44e4a5b13a
commit
375de4f8a6
@ -28,7 +28,6 @@
|
||||
|
||||
#include "torrentcategorydialog.h"
|
||||
|
||||
#include <QMap>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include <QFileIconProvider>
|
||||
#include <QFileInfo>
|
||||
#include <QIcon>
|
||||
#include <QMap>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <Windows.h>
|
||||
|
@ -537,7 +537,7 @@ void WebApplication::sessionStart()
|
||||
|
||||
// remove outdated sessions
|
||||
const qint64 now = QDateTime::currentMSecsSinceEpoch() / 1000;
|
||||
const QMap<QString, WebSession *> sessionsCopy {m_sessions};
|
||||
const QHash<QString, WebSession *> sessionsCopy {m_sessions};
|
||||
for (const auto session : sessionsCopy) {
|
||||
if ((now - session->timestamp()) > INACTIVE_TIME)
|
||||
delete m_sessions.take(session->id());
|
||||
|
@ -30,7 +30,6 @@
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QRegularExpression>
|
||||
#include <QSet>
|
||||
@ -120,7 +119,7 @@ private:
|
||||
bool validateHostHeader(const QStringList &domains) const;
|
||||
|
||||
// Persistent data
|
||||
QMap<QString, WebSession *> m_sessions;
|
||||
QHash<QString, WebSession *> m_sessions;
|
||||
|
||||
// Current data
|
||||
WebSession *m_currentSession = nullptr;
|
||||
@ -141,7 +140,7 @@ private:
|
||||
QByteArray data;
|
||||
QDateTime lastModified;
|
||||
};
|
||||
QMap<QString, TranslatedFile> m_translatedFiles;
|
||||
QHash<QString, TranslatedFile> m_translatedFiles;
|
||||
QString m_currentLocale;
|
||||
QTranslator m_translator;
|
||||
bool m_translationFileLoaded = false;
|
||||
|
Loading…
Reference in New Issue
Block a user