C++: optimize the semantic highlighting in the UI thread.

Done by reserving enough space in for the various QLists when created,
and by preventing unnecessary copying of lists.

Change-Id: I5a9f0f7042bbaa1cf5eb076b956c35f2191468c6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-02-26 11:17:13 +01:00
committed by Erik Verbruggen
parent ff6e100824
commit 97c6af9443
4 changed files with 20 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ public:
void setDocument(QTextDocument *doc);
QTextDocument *document() const;
void setExtraAdditionalFormats(const QTextBlock& block, const QList<QTextLayout::FormatRange> &formats);
void setExtraAdditionalFormats(const QTextBlock& block, QList<QTextLayout::FormatRange> &formats);
static QList<QColor> generateColors(int n, const QColor &background);