summaryrefslogtreecommitdiff
path: root/src/xmlpatterns/schema/qxsdschemachecker.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-04 16:55:29 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-09-20 17:19:31 +0000
commitb1b57225dbc8733935697e1895631969e9a95376 (patch)
tree0a7f40c74bd90e83f6600ed361f7ace81b4e6f86 /src/xmlpatterns/schema/qxsdschemachecker.cpp
parentdba42c925db368aa958c38c6a3481f18a57bd71f (diff)
downloadqtxmlpatterns-b1b57225dbc8733935697e1895631969e9a95376.tar.gz
Eradicate Java-style loops (II): QSetIterator -> C++11 ranged for
Java-style iterators are slower than STL-style ones, so they should not be used in library code. Replaced them with C++11 ranged for loops, adding qAsConst() as needed. Change-Id: I21b59daceafc62b94ebba56bfef1f050988b9c9f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/xmlpatterns/schema/qxsdschemachecker.cpp')
-rw-r--r--src/xmlpatterns/schema/qxsdschemachecker.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xmlpatterns/schema/qxsdschemachecker.cpp b/src/xmlpatterns/schema/qxsdschemachecker.cpp
index b6e51f3..0898848 100644
--- a/src/xmlpatterns/schema/qxsdschemachecker.cpp
+++ b/src/xmlpatterns/schema/qxsdschemachecker.cpp
@@ -1694,9 +1694,8 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses()
void XsdSchemaChecker::checkElementConstraints()
{
const QSet<XsdElement::Ptr> elements = collectAllElements(m_schema);
- QSetIterator<XsdElement::Ptr> it(elements);
- while (it.hasNext()) {
- const XsdElement::Ptr element = it.next();
+
+ for (const XsdElement::Ptr &element : elements) {
// @see http://www.w3.org/TR/xmlschema11-1/#e-props-correct