summaryrefslogtreecommitdiff
path: root/src/xmlpatterns/expr/qexpressionfactory.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-21 08:35:11 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-21 08:35:11 +0200
commit0aaf8a5f8541960466d695729104d71c23998df9 (patch)
treed8d37fb42f923eaad78a85157d2f655e8a2c2d2e /src/xmlpatterns/expr/qexpressionfactory.cpp
parenta7c672c05a29ee6894197c77063a307ea022a97b (diff)
parent21cc71ced3565585f7a2f94875ed845355ab2064 (diff)
downloadqtxmlpatterns-0aaf8a5f8541960466d695729104d71c23998df9.tar.gz
Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: Ie4eaf067382d8ca5e139a994e045e83f3f90760c
Diffstat (limited to 'src/xmlpatterns/expr/qexpressionfactory.cpp')
-rw-r--r--src/xmlpatterns/expr/qexpressionfactory.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/xmlpatterns/expr/qexpressionfactory.cpp b/src/xmlpatterns/expr/qexpressionfactory.cpp
index f205def..b0e43be 100644
--- a/src/xmlpatterns/expr/qexpressionfactory.cpp
+++ b/src/xmlpatterns/expr/qexpressionfactory.cpp
@@ -279,11 +279,7 @@ Expression::Ptr ExpressionFactory::createExpression(const Tokenizer::Ptr &tokeni
{
pDebug() << "Have " << info->namedTemplates.count() << "named templates";
- QMutableHashIterator<QXmlName, Template::Ptr> it(info->namedTemplates);
-
- while(it.hasNext())
- {
- it.next();
+ for (auto it = info->namedTemplates.cbegin(), end = info->namedTemplates.cend(); it != end; ++it) {
processNamedTemplate(it.key(), it.value()->body, TemplateInitial);
it.value()->body = it.value()->body->typeCheck(context, CommonSequenceTypes::ZeroOrMoreItems);
@@ -298,7 +294,6 @@ Expression::Ptr ExpressionFactory::createExpression(const Tokenizer::Ptr &tokeni
/* Type check and compress template rules. */
{
- QHashIterator<QXmlName, TemplateMode::Ptr> it(info->templateRules);
/* Since a pattern can exist of AxisStep, its typeCheck() stage
* requires a focus. In the case that we're invoked with a name but
@@ -313,9 +308,7 @@ Expression::Ptr ExpressionFactory::createExpression(const Tokenizer::Ptr &tokeni
patternContext = StaticContext::Ptr(new StaticFocusContext(BuiltinTypes::node, context));
/* For each template pattern. */
- while(it.hasNext())
- {
- it.next();
+ for (auto it = info->templateRules.cbegin(), end = info->templateRules.cend(); it != end; ++it) {
const TemplateMode::Ptr &mode = it.value();
const int len = mode->templatePatterns.count();
TemplatePattern::ID currentTemplateID = -1;
@@ -387,12 +380,7 @@ Expression::Ptr ExpressionFactory::createExpression(const Tokenizer::Ptr &tokeni
Q_ASSERT_X(modeAll, Q_FUNC_INFO,
"We should at least have the builtin templates.");
- QHashIterator<QXmlName, TemplateMode::Ptr> it(info->templateRules);
-
- while(it.hasNext())
- {
- it.next();
-
+ for (auto it = info->templateRules.cbegin(), end = info->templateRules.cend(); it != end; ++it) {
/* Don't add mode #all to mode #all. */
if(it.key() == nameModeAll)
continue;