diff options
author | Kai Köhne <kai.koehne@qt.io> | 2021-06-15 20:25:49 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2021-06-17 09:54:42 +0000 |
commit | bf04c98c1c3d8e03db61b0811e1cc47517c49afa (patch) | |
tree | f0b84dd13e5610f90e9d9e08f109a6865cb70625 /src/plugins/qmljseditor | |
parent | 4bfcea22bf31ad7d9718d5d30402d74ba0568dac (diff) |
Do not pass QStringView by const reference
That's what the documentation says:
https://doc.qt.io/qt-6/qstringview.html#details
Change-Id: I0b41fc4abad1601c0ed416a505534cf7ae7633e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r-- | src/plugins/qmljseditor/qmljsautocompleter.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmljseditor/qmljseditor.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmljseditor/qmljshighlighter.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmljseditor/qmljshighlighter.h | 4 | ||||
-rw-r--r-- | src/plugins/qmljseditor/qmljssemantichighlighter.cpp | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp index 43209507ca5..60ebeb68a64 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.cpp +++ b/src/plugins/qmljseditor/qmljsautocompleter.cpp @@ -121,7 +121,7 @@ static bool shouldInsertNewline(const QTextCursor &tc) return false; } -static bool isCompleteStringLiteral(const QStringView &text) +static bool isCompleteStringLiteral(QStringView text) { if (text.length() < 2) return false; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 39105a0406c..b6f8287561a 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -417,7 +417,7 @@ protected: { UiQualifiedId *id = qualifiedTypeNameId(member); if (id) { - const QStringView &name = id->name; + QStringView name = id->name; if (!name.isEmpty() && name.at(0).isUpper()) return true; } @@ -435,7 +435,7 @@ protected: else if (script->qualifiedId->next) return false; - const QStringView &propertyName = script->qualifiedId->name; + QStringView propertyName = script->qualifiedId->name; if (propertyName == QLatin1String("id")) return true; diff --git a/src/plugins/qmljseditor/qmljshighlighter.cpp b/src/plugins/qmljseditor/qmljshighlighter.cpp index 998021ce50b..86f8cfbd64c 100644 --- a/src/plugins/qmljseditor/qmljshighlighter.cpp +++ b/src/plugins/qmljseditor/qmljshighlighter.cpp @@ -202,7 +202,7 @@ void QmlJSHighlighter::highlightBlock(const QString &text) onBlockEnd(m_scanner.state()); } -bool QmlJSHighlighter::maybeQmlKeyword(const QStringView &text) const +bool QmlJSHighlighter::maybeQmlKeyword(QStringView text) const { if (text.isEmpty()) return false; @@ -228,7 +228,7 @@ bool QmlJSHighlighter::maybeQmlKeyword(const QStringView &text) const return false; } -bool QmlJSHighlighter::maybeQmlBuiltinType(const QStringView &text) const +bool QmlJSHighlighter::maybeQmlBuiltinType(QStringView text) const { if (text.isEmpty()) return false; diff --git a/src/plugins/qmljseditor/qmljshighlighter.h b/src/plugins/qmljseditor/qmljshighlighter.h index 07bd8736ff8..88c72528fe3 100644 --- a/src/plugins/qmljseditor/qmljshighlighter.h +++ b/src/plugins/qmljseditor/qmljshighlighter.h @@ -56,8 +56,8 @@ protected: void onOpeningParenthesis(QChar parenthesis, int pos, bool atStart); void onClosingParenthesis(QChar parenthesis, int pos, bool atEnd); - bool maybeQmlKeyword(const QStringView &text) const; - bool maybeQmlBuiltinType(const QStringView &text) const; + bool maybeQmlKeyword(QStringView text) const; + bool maybeQmlBuiltinType(QStringView text) const; private: bool m_qmlEnabled; diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp index 9db93925a34..1236cc1b9f3 100644 --- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp +++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp @@ -239,7 +239,7 @@ protected: m_scopeBuilder.pop(); } - void processName(const QStringView &name, SourceLocation location) + void processName(QStringView name, SourceLocation location) { if (name.isEmpty()) return; |