summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2015-05-25 17:13:28 +0100
committerSérgio Martins <sergio.martins@kdab.com>2015-05-26 15:00:30 +0000
commit5eb09c649e399ee6f3d4101d4cfb4c802f9da5e3 (patch)
treec6c6a992db27d72d9a39843e58258223a844c910 /src
parentd41d5d90fb8df48df47b7d8a267ef08683066a0e (diff)
downloadqtxmlpatterns-5eb09c649e399ee6f3d4101d4cfb4c802f9da5e3.tar.gz
Replace containsSet() with QSet::contains()
We have a QSet::contains() since 4.6. Change-Id: Idbafeec6e58aadff4a07e7ed50ac54dc8738623a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/xmlpatterns/schema/qxsdschemahelper.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp
index b0fbf31..f6e9b98 100644
--- a/src/xmlpatterns/schema/qxsdschemahelper.cpp
+++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp
@@ -150,19 +150,6 @@ bool XsdSchemaHelper::wildcardAllowsExpandedName(const QXmlName &name, const Xsd
return true;
}
-// small helper function that should be available in Qt 4.6
-template<class T>
-static inline bool containsSet(const QSet<T> &super, const QSet<T> &sub)
-{
- QSetIterator<T> it(sub);
- while (it.hasNext()) {
- if (!super.contains(it.next()))
- return false;
- }
-
- return true;
-}
-
bool XsdSchemaHelper::isWildcardSubset(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard)
{
// @see http://www.w3.org/TR/xmlschema11-1/#cos-ns-subset
@@ -178,7 +165,7 @@ bool XsdSchemaHelper::isWildcardSubset(const XsdWildcard::Ptr &wildcard, const X
// 2
if ((constraint->variety() == XsdWildcard::NamespaceConstraint::Enumeration) && (otherConstraint->variety() == XsdWildcard::NamespaceConstraint::Enumeration)) {
- if (containsSet<QString>(otherConstraint->namespaces(), constraint->namespaces()))
+ if (otherConstraint->namespaces().contains(constraint->namespaces()))
return true;
}
@@ -190,7 +177,7 @@ bool XsdSchemaHelper::isWildcardSubset(const XsdWildcard::Ptr &wildcard, const X
// 4
if ((constraint->variety() == XsdWildcard::NamespaceConstraint::Not) && (otherConstraint->variety() == XsdWildcard::NamespaceConstraint::Not)) {
- if (containsSet<QString>(constraint->namespaces(), otherConstraint->namespaces()))
+ if (constraint->namespaces().contains(otherConstraint->namespaces()))
return true;
}