LanguageClient: Improve use of Client::m_documentsToUpdate

In particular, calling keys() and then take() for all the keys is
wasteful (and obscures what's going on).

Change-Id: Ic66803cf3579a39c23c32f1fc65e2c9399dcc583
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-14 12:13:56 +02:00
parent e397394090
commit 30cbda2b2d
2 changed files with 16 additions and 16 deletions

View File

@@ -62,6 +62,8 @@
#include <QJsonDocument>
#include <QTextCursor>
#include <unordered_map>
namespace Core { class IDocument; }
namespace ProjectExplorer { class Project; }
namespace TextEditor
@@ -252,7 +254,7 @@ private:
QMap<TextEditor::TextDocument *, QString> m_openedDocument;
QSet<TextEditor::TextDocument *> m_postponedDocuments;
QMap<Utils::FilePath, int> m_documentVersions;
QMap<TextEditor::TextDocument *,
std::unordered_map<TextEditor::TextDocument *,
QList<LanguageServerProtocol::DidChangeTextDocumentParams::TextDocumentContentChangeEvent>>
m_documentsToUpdate;
QMap<TextEditor::TextEditorWidget *, QTimer *> m_documentHighlightsTimer;