diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-18 18:01:29 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-02-10 11:17:37 +0000 |
commit | 71888aa3a4fa564dae17f00be6a04b34a19db862 (patch) | |
tree | 15e96303205e27c011431743bff1113d1a2e3782 /src/qml/qml/qqmlscriptstring.cpp | |
parent | 397d16fee1f023d3ae741a513334009823f1163c (diff) |
Qml: replace QStringLiteral with QLatin1String
... in string comparisons. It's more efficient.
Change-Id: I3be5a2be9ba5d55546472eac28f5f639a496bf3b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlscriptstring.cpp')
-rw-r--r-- | src/qml/qml/qqmlscriptstring.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlscriptstring.cpp b/src/qml/qml/qqmlscriptstring.cpp index b027f043ec..3230e69b6d 100644 --- a/src/qml/qml/qqmlscriptstring.cpp +++ b/src/qml/qml/qqmlscriptstring.cpp @@ -135,10 +135,10 @@ bool QQmlScriptString::operator==(const QQmlScriptString &other) const if (d->isStringLiteral || other.d->isStringLiteral) return d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script; - if (d->script == QStringLiteral("true") || - d->script == QStringLiteral("false") || - d->script == QStringLiteral("undefined") || - d->script == QStringLiteral("null")) + if (d->script == QLatin1String("true") || + d->script == QLatin1String("false") || + d->script == QLatin1String("undefined") || + d->script == QLatin1String("null")) return d->script == other.d->script; return d->context == other.d->context && @@ -172,7 +172,7 @@ Returns whether the content of the QQmlScriptString is the \c undefined literal. */ bool QQmlScriptString::isUndefinedLiteral() const { - return d->script == QStringLiteral("undefined"); + return d->script == QLatin1String("undefined"); } /*! @@ -180,7 +180,7 @@ Returns whether the content of the QQmlScriptString is the \c null literal. */ bool QQmlScriptString::isNullLiteral() const { - return d->script == QStringLiteral("null"); + return d->script == QLatin1String("null"); } /*! @@ -211,8 +211,8 @@ sets \a ok to true. Otherwise returns false and sets \a ok to false. */ bool QQmlScriptString::booleanLiteral(bool *ok) const { - bool isTrue = d->script == QStringLiteral("true"); - bool isFalse = !isTrue && d->script == QStringLiteral("false"); + bool isTrue = d->script == QLatin1String("true"); + bool isFalse = !isTrue && d->script == QLatin1String("false"); if (ok) *ok = isTrue || isFalse; return isTrue ? true : false; |