diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-11-17 00:23:17 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-11-17 14:38:17 +0000 |
commit | 2c919c43bef9131885204f9416cc93cffd711225 (patch) | |
tree | a4162d2ffb7f2f741b457958d24e46439cbd9b91 /src/plugins/languageclient | |
parent | 5efbdd5f10d138824b166f2505169d75ff5432f7 (diff) | |
download | qt-creator-2c919c43bef9131885204f9416cc93cffd711225.tar.gz |
Use QHash instead of QMap when key is a pointer type
Ordering in container by pointer to memory doesn't make much sense.
QHash is faster for lookups in this case.
Change-Id: I0d4bdac7f5bb9afffdeaef70b99326547c080f55
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/languageclient')
-rw-r--r-- | src/plugins/languageclient/languageclientutils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/languageclient/languageclientutils.cpp b/src/plugins/languageclient/languageclientutils.cpp index a97bd7ff50..4b10ccdd54 100644 --- a/src/plugins/languageclient/languageclientutils.cpp +++ b/src/plugins/languageclient/languageclientutils.cpp @@ -207,7 +207,7 @@ void updateEditorToolBar(Core::IEditor *editor) TextDocument *document = textEditor->textDocument(); Client *client = LanguageClientManager::clientForDocument(textEditor->textDocument()); - static QMap<QWidget *, QAction *> actions; + static QHash<QWidget *, QAction *> actions; if (actions.contains(widget)) { auto action = actions[widget]; @@ -253,7 +253,7 @@ void updateEditorToolBar(Core::IEditor *editor) }); } - static QMap<QWidget *, QPair<Client *, QAction *>> outlines; + static QHash<QWidget *, QPair<Client *, QAction *>> outlines; if (outlines.contains(widget)) { auto outline = outlines[widget]; |