Commit 166373e4 authored by Fabian Kosmale's avatar Fabian Kosmale
Browse files

use std::sort instead of qSort (faster); use range based for loop (more readable)

parent f0283d2c
......@@ -19,6 +19,7 @@
#include <QThreadPool>
#include <QDebug>
#include <numeric>
#include <algorithm>
namespace Akabei
{
......@@ -218,8 +219,8 @@ void OperationRunnerPrivate::__k__doValidate()
{
Q_Q(OperationRunner);
// First of all, sort all the operations by priority
for (QHash<Operation::Phase, QList< Operation* > >::iterator i = operations.begin(); i != operations.end(); ++i) {
qSort(i.value().begin(), i.value().end(), priorityLessThan);
for (auto& elem: operations) {
std::sort(std::begin(elem), std::end(elem), priorityLessThan);
}
valThread = new ValidatorRunnable(operations, processingOptions);
......@@ -252,8 +253,8 @@ void OperationRunner::run()
return;
}
// First of all, sort all the operations by priority
for (QHash<Operation::Phase, QList< Operation* > >::iterator i = d->operations.begin(); i != d->operations.end(); ++i) {
qSort(i.value().begin(), i.value().end(), priorityLessThan);
for (auto& operation: d->operations) {
std::sort(std::begin(operation), std::end(operation), priorityLessThan );
}
d->runThread = new RunnerRunnable(d->operations, d->processingOptions);
......
Markdown is supported
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