Replace QMap with QHash when the key is a pointer

QHash gives faster lookups than QMap when the key is a pointer.
This commit is contained in:
Gianluca Recchia 2019-01-17 06:03:58 +01:00 committed by Jonathan White
parent 9a5bbea2e4
commit ffea029001
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
2 changed files with 4 additions and 3 deletions

View file

@ -19,6 +19,7 @@
#ifndef KEEPASSX_MESSAGEBOX_H
#define KEEPASSX_MESSAGEBOX_H
#include <QHash>
#include <QMap>
#include <QMessageBox>
#include <QPushButton>
@ -102,7 +103,7 @@ public:
private:
static Button m_nextAnswer;
static QMap<QAbstractButton*, Button> m_addedButtonLookup;
static QHash<QAbstractButton*, Button> m_addedButtonLookup;
static QMap<Button, std::pair<QString, QMessageBox::ButtonRole>> m_buttonDefs;
static Button messageBox(QWidget* parent,