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>
This commit is contained in:
Kai Köhne
2021-06-15 20:25:49 +02:00
committed by Kai Koehne
parent 4bfcea22bf
commit bf04c98c1c
22 changed files with 68 additions and 68 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;