From 375de4f8a68157cfbc653ee10f947f84d5b5e5be Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 26 Apr 2019 02:50:40 +0800 Subject: [PATCH] Replace QMap with QHash when sensible --- src/gui/torrentcategorydialog.cpp | 1 - src/gui/torrentcontentmodel.cpp | 1 - src/webui/webapplication.cpp | 2 +- src/webui/webapplication.h | 5 ++--- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/torrentcategorydialog.cpp b/src/gui/torrentcategorydialog.cpp index 099696371..e7d269af9 100644 --- a/src/gui/torrentcategorydialog.cpp +++ b/src/gui/torrentcategorydialog.cpp @@ -28,7 +28,6 @@ #include "torrentcategorydialog.h" -#include #include #include "base/bittorrent/session.h" diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index 14c52ca54..1602834aa 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #if defined(Q_OS_WIN) #include diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index ef2202b1b..4e07bc499 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -537,7 +537,7 @@ void WebApplication::sessionStart() // remove outdated sessions const qint64 now = QDateTime::currentMSecsSinceEpoch() / 1000; - const QMap sessionsCopy {m_sessions}; + const QHash sessionsCopy {m_sessions}; for (const auto session : sessionsCopy) { if ((now - session->timestamp()) > INACTIVE_TIME) delete m_sessions.take(session->id()); diff --git a/src/webui/webapplication.h b/src/webui/webapplication.h index 1c38d65b8..e59e0d97f 100644 --- a/src/webui/webapplication.h +++ b/src/webui/webapplication.h @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -120,7 +119,7 @@ private: bool validateHostHeader(const QStringList &domains) const; // Persistent data - QMap m_sessions; + QHash m_sessions; // Current data WebSession *m_currentSession = nullptr; @@ -141,7 +140,7 @@ private: QByteArray data; QDateTime lastModified; }; - QMap m_translatedFiles; + QHash m_translatedFiles; QString m_currentLocale; QTranslator m_translator; bool m_translationFileLoaded = false;