Commit 11b150d9 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by The Qt Project
Browse files

Remove QtAlgorithms usage from QtXmlPatterns.

QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html



Change-Id: I4e2c7bf7970ba59ca9443c545b66db9f509d946b
Reviewed-by: default avatarGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Showing with 10 additions and 4 deletions
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include "qdeduplicateiterator_p.h" #include "qdeduplicateiterator_p.h"
#include "qnodesort_p.h" #include "qnodesort_p.h"
#include <algorithm>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace QPatternist; using namespace QPatternist;
...@@ -83,7 +85,7 @@ Item::Iterator::Ptr NodeSortExpression::evaluateSequence(const DynamicContext::P ...@@ -83,7 +85,7 @@ Item::Iterator::Ptr NodeSortExpression::evaluateSequence(const DynamicContext::P
return makeListIterator(nodes); return makeListIterator(nodes);
else else
{ {
qSort(nodes.begin(), nodes.end(), lessThanUsingNodeModel); std::sort(nodes.begin(), nodes.end(), lessThanUsingNodeModel);
return Item::Iterator::Ptr(new DeduplicateIterator(nodes)); return Item::Iterator::Ptr(new DeduplicateIterator(nodes));
} }
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include "qorderby_p.h" #include "qorderby_p.h"
#include <algorithm>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace QPatternist; using namespace QPatternist;
...@@ -182,11 +184,11 @@ Item::Iterator::Ptr OrderBy::evaluateSequence(const DynamicContext::Ptr &context ...@@ -182,11 +184,11 @@ Item::Iterator::Ptr OrderBy::evaluateSequence(const DynamicContext::Ptr &context
/* On one hand we could just disregard stability and always use qStableSort(), but maybe qSort() /* On one hand we could just disregard stability and always use qStableSort(), but maybe qSort()
* is a bit faster? */ * is a bit faster? */
if(m_stability == StableOrder) if(m_stability == StableOrder)
qStableSort(tuples.begin(), tuples.end(), sorter); std::stable_sort(tuples.begin(), tuples.end(), sorter);
else else
{ {
Q_ASSERT(m_stability == UnstableOrder); Q_ASSERT(m_stability == UnstableOrder);
qSort(tuples.begin(), tuples.end(), sorter); std::sort(tuples.begin(), tuples.end(), sorter);
} }
return makeSequenceMappingIterator<Item>(ConstPtr(this), return makeSequenceMappingIterator<Item>(ConstPtr(this),
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include "qtemplatemode_p.h" #include "qtemplatemode_p.h"
#include <algorithm>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace QPatternist; using namespace QPatternist;
...@@ -53,7 +55,7 @@ bool TemplateMode::lessThanByPriority(const TemplatePattern::Ptr &t1, ...@@ -53,7 +55,7 @@ bool TemplateMode::lessThanByPriority(const TemplatePattern::Ptr &t1,
void TemplateMode::finalize() void TemplateMode::finalize()
{ {
qSort(templatePatterns.begin(), templatePatterns.end(), lessThanByPriority); std::sort(templatePatterns.begin(), templatePatterns.end(), lessThanByPriority);
/* Now we have a list of patterns sorted by priority. */ /* Now we have a list of patterns sorted by priority. */
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment