summaryrefslogtreecommitdiff
path: root/src/xmlpatterns
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r--src/xmlpatterns/expr/qexpressionsequence.cpp10
-rw-r--r--src/xmlpatterns/functions/qconstructorfunctionsfactory.cpp5
-rw-r--r--src/xmlpatterns/functions/qfunctionfactorycollection.cpp5
-rw-r--r--src/xmlpatterns/xmlpatterns.pro9
4 files changed, 11 insertions, 18 deletions
diff --git a/src/xmlpatterns/expr/qexpressionsequence.cpp b/src/xmlpatterns/expr/qexpressionsequence.cpp
index 193e15f..d796de4 100644
--- a/src/xmlpatterns/expr/qexpressionsequence.cpp
+++ b/src/xmlpatterns/expr/qexpressionsequence.cpp
@@ -46,6 +46,9 @@
#include "qexpressionsequence_p.h"
+#include <algorithm>
+#include <iterator>
+
QT_BEGIN_NAMESPACE
using namespace QPatternist;
@@ -109,11 +112,8 @@ Expression::Ptr ExpressionSequence::compress(const StaticContext::Ptr &context)
else if(Id == IDExpressionSequence)
{
/* Rewrite "(1, (2, 3), 4)" into "(1, 2, 3, 4)" */
- Expression::List::const_iterator seqIt((*it)->operands().constBegin());
- const Expression::List::const_iterator seqEnd((*it)->operands().constEnd());
-
- for(; seqIt != seqEnd; ++seqIt)
- result.append(*seqIt);
+ const auto &operands = (*it)->operands();
+ std::copy(operands.cbegin(), operands.cend(), std::back_inserter(result));
} else if (Id == IDLiteralSequence) {
/* Rewrite "(1, (2, 3), 4)" into "(1, 2, 3, 4)" */
// Note: LiteralSequence does not use the dynamic context, so we pass in a nullptr.
diff --git a/src/xmlpatterns/functions/qconstructorfunctionsfactory.cpp b/src/xmlpatterns/functions/qconstructorfunctionsfactory.cpp
index 67c9e84..10d5829 100644
--- a/src/xmlpatterns/functions/qconstructorfunctionsfactory.cpp
+++ b/src/xmlpatterns/functions/qconstructorfunctionsfactory.cpp
@@ -58,8 +58,9 @@ ConstructorFunctionsFactory::ConstructorFunctionsFactory(const NamePool::Ptr &np
{
Q_ASSERT(m_typeFactory);
Q_ASSERT(np);
- SchemaType::Hash::const_iterator it(m_typeFactory->types().constBegin());
- const SchemaType::Hash::const_iterator end(m_typeFactory->types().constEnd());
+ const auto &schemaHash = m_typeFactory->types();
+ SchemaType::Hash::const_iterator it(schemaHash.constBegin());
+ const SchemaType::Hash::const_iterator end(schemaHash.constEnd());
FunctionArgument::List args;
const QXmlName argName(StandardNamespaces::empty, StandardLocalNames::sourceValue);
diff --git a/src/xmlpatterns/functions/qfunctionfactorycollection.cpp b/src/xmlpatterns/functions/qfunctionfactorycollection.cpp
index 6c10425..1deb3cc 100644
--- a/src/xmlpatterns/functions/qfunctionfactorycollection.cpp
+++ b/src/xmlpatterns/functions/qfunctionfactorycollection.cpp
@@ -92,8 +92,9 @@ FunctionSignature::Hash FunctionFactoryCollection::functionSignatures() const
for(const_iterator it(constBegin()); it != e; ++it)
{
- const FunctionSignature::Hash::const_iterator e2((*it)->functionSignatures().constEnd());
- FunctionSignature::Hash::const_iterator sit((*it)->functionSignatures().constBegin());
+ const auto &signatures = (*it)->functionSignatures();
+ const FunctionSignature::Hash::const_iterator e2(signatures.constEnd());
+ FunctionSignature::Hash::const_iterator sit(signatures.constBegin());
for(; sit != e2; ++sit)
result.insert(sit.key(), sit.value());
diff --git a/src/xmlpatterns/xmlpatterns.pro b/src/xmlpatterns/xmlpatterns.pro
index 5244bb1..eae2ea8 100644
--- a/src/xmlpatterns/xmlpatterns.pro
+++ b/src/xmlpatterns/xmlpatterns.pro
@@ -26,13 +26,4 @@ include($$PWD/type/type.pri)
include($$PWD/utils/utils.pri)
include($$PWD/qobjectmodel/qobjectmodel.pri, "", true)
-wince* {
- # The Microsoft MIPS compiler crashes if /Og is specified.
- # -O2/1 expands to /Og plus additional arguments.
- contains(DEFINES, MIPS) {
- QMAKE_CXXFLAGS_RELEASE ~= s/-O2/-Oi -Ot -Oy -Ob2/
- QMAKE_CXXFLAGS_RELEASE ~= s/-O1/-Os -Oy -Ob2/
- }
-}
-
load(qt_module)