aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/texteditor/semantichighlighter.cpp2
-rw-r--r--src/plugins/texteditor/syntaxhighlighter.cpp4
-rw-r--r--src/plugins/texteditor/syntaxhighlighter.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/texteditor/semantichighlighter.cpp b/src/plugins/texteditor/semantichighlighter.cpp
index 9dded606ba..17cfc1374b 100644
--- a/src/plugins/texteditor/semantichighlighter.cpp
+++ b/src/plugins/texteditor/semantichighlighter.cpp
@@ -112,7 +112,7 @@ void SemanticHighlighter::incrementalApplyExtraAdditionalFormats(
if (nextBlockNumber != blockNumber)
break;
}
- highlighter->setExtraFormats(b, formats);
+ highlighter->setExtraFormats(b, std::move(formats));
b = b.next();
++currentBlockNumber;
}
diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp
index 0680246135..8f7f1f153e 100644
--- a/src/plugins/texteditor/syntaxhighlighter.cpp
+++ b/src/plugins/texteditor/syntaxhighlighter.cpp
@@ -662,10 +662,10 @@ static bool byStartOfRange(const QTextLayout::FormatRange &range, const QTextLay
return range.start < other.start;
}
-// The formats is passed in by reference in order to prevent unnecessary copying of its items.
+// The formats is passed in by rvalue reference in order to prevent unnecessary copying of its items.
// After this function returns, the list is modified, and should be considered invalidated!
void SyntaxHighlighter::setExtraFormats(const QTextBlock &block,
- QVector<QTextLayout::FormatRange> &formats)
+ QVector<QTextLayout::FormatRange> &&formats)
{
Q_D(SyntaxHighlighter);
diff --git a/src/plugins/texteditor/syntaxhighlighter.h b/src/plugins/texteditor/syntaxhighlighter.h
index f55b9f9f00..bbd23a77d4 100644
--- a/src/plugins/texteditor/syntaxhighlighter.h
+++ b/src/plugins/texteditor/syntaxhighlighter.h
@@ -63,7 +63,7 @@ public:
void setDocument(QTextDocument *doc);
QTextDocument *document() const;
- void setExtraFormats(const QTextBlock &block, QVector<QTextLayout::FormatRange> &formats);
+ void setExtraFormats(const QTextBlock &block, QVector<QTextLayout::FormatRange> &&formats);
void clearExtraFormats(const QTextBlock &block);
static QList<QColor> generateColors(int n, const QColor &background);