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/compiler/qv4codegen.cpp | |
parent | 397d16fee1f023d3ae741a513334009823f1163c (diff) | |
download | qtdeclarative-71888aa3a4fa564dae17f00be6a04b34a19db862.tar.gz |
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/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index eab5b7fd2d..d08d2aafa2 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -115,7 +115,7 @@ void Codegen::ScanFunctions::checkDirectivePrologue(SourceElements *ast) if (strLit->literalToken.length < 2) continue; QStringRef str = _sourceCode.midRef(strLit->literalToken.offset + 1, strLit->literalToken.length - 2); - if (str == QStringLiteral("use strict")) { + if (str == QLatin1String("use strict")) { _env->isStrict = true; } else { // TODO: give a warning. @@ -148,7 +148,7 @@ void Codegen::ScanFunctions::checkName(const QStringRef &name, const SourceLocat void Codegen::ScanFunctions::checkForArguments(AST::FormalParameterList *parameters) { while (parameters) { - if (parameters->name == QStringLiteral("arguments")) + if (parameters->name == QLatin1String("arguments")) _env->usesArgumentsObject = Environment::ArgumentsObjectNotUsed; parameters = parameters->next; } @@ -170,7 +170,7 @@ bool Codegen::ScanFunctions::visit(CallExpression *ast) { if (! _env->hasDirectEval) { if (IdentifierExpression *id = cast<IdentifierExpression *>(ast->base)) { - if (id->name == QStringLiteral("eval")) { + if (id->name == QLatin1String("eval")) { if (_env->usesArgumentsObject == Environment::ArgumentsObjectUnknown) _env->usesArgumentsObject = Environment::ArgumentsObjectUsed; _env->hasDirectEval = true; @@ -241,7 +241,7 @@ bool Codegen::ScanFunctions::visit(ExpressionStatement *ast) return false; } else { SourceLocation firstToken = ast->firstSourceLocation(); - if (_sourceCode.midRef(firstToken.offset, firstToken.length) == QStringLiteral("function")) { + if (_sourceCode.midRef(firstToken.offset, firstToken.length) == QLatin1String("function")) { _cg->throwSyntaxError(firstToken, QStringLiteral("unexpected token")); } } @@ -1441,7 +1441,7 @@ IR::Expr *Codegen::identifier(const QString &name, int line, int col) Q_ASSERT (index < e->members.size()); if (index != -1) { IR::ArgLocal *al = _block->LOCAL(index, scope); - if (name == QStringLiteral("arguments") || name == QStringLiteral("eval")) + if (name == QLatin1String("arguments") || name == QLatin1String("eval")) al->isArgumentsOrEval = true; return al; } |