diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-09-04 16:55:29 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-09-20 18:24:49 +0000 |
commit | 21cc71ced3565585f7a2f94875ed845355ab2064 (patch) | |
tree | fc9c632572e6f69d3753bc4a2658cec3e5cc7bff /src/xmlpatterns/schema/qxsdtypechecker.cpp | |
parent | b1b57225dbc8733935697e1895631969e9a95376 (diff) | |
download | qtxmlpatterns-21cc71ced3565585f7a2f94875ed845355ab2064.tar.gz |
Eradicate Java-style loops (I): QHashIterator -> STL-style
Java-style iterators are slower than STL-style ones, so
they should not be used in library code.
Replaced them with STL iterator loops.
In one case, a QMutableHashIterator actually needn't be
mutable, so ported to const_iterator, like all others.
Change-Id: Ib7fd1fa5fca2df2c288a61925ee68a5df11caf62
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/xmlpatterns/schema/qxsdtypechecker.cpp')
-rw-r--r-- | src/xmlpatterns/schema/qxsdtypechecker.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/xmlpatterns/schema/qxsdtypechecker.cpp b/src/xmlpatterns/schema/qxsdtypechecker.cpp index 7c554c5..2e4ce8e 100644 --- a/src/xmlpatterns/schema/qxsdtypechecker.cpp +++ b/src/xmlpatterns/schema/qxsdtypechecker.cpp @@ -206,12 +206,8 @@ XsdFacet::Hash XsdTypeChecker::mergedFacetsForType(const SchemaType::Ptr &type, const XsdFacet::Hash facets = context->facetsForType(type); XsdFacet::Hash result = baseFacets; - XsdFacet::HashIterator it(facets); - while (it.hasNext()) { - it.next(); - + for (auto it = facets.cbegin(), end = facets.cend(); it != end; ++it) result.insert(it.key(), it.value()); - } return result; } |