mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
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:
parent
9a5bbea2e4
commit
ffea029001
@ -20,8 +20,8 @@
|
||||
|
||||
MessageBox::Button MessageBox::m_nextAnswer(MessageBox::NoButton);
|
||||
|
||||
QMap<QAbstractButton*, MessageBox::Button> MessageBox::m_addedButtonLookup =
|
||||
QMap<QAbstractButton*, MessageBox::Button>();
|
||||
QHash<QAbstractButton*, MessageBox::Button> MessageBox::m_addedButtonLookup =
|
||||
QHash<QAbstractButton*, MessageBox::Button>();
|
||||
|
||||
QMap<MessageBox::Button, std::pair<QString, QMessageBox::ButtonRole>> MessageBox::m_buttonDefs =
|
||||
QMap<MessageBox::Button, std::pair<QString, QMessageBox::ButtonRole>>();
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user