mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Fixes of review included (Concurrency 2, https://dev.vatsim-germany.org/issues/325#note-14)
This commit is contained in:
@@ -492,17 +492,6 @@ namespace BlackMisc
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Return a copy as derived container sorted by a given comparator predicate.
|
||||
*/
|
||||
template <class TargetContainer, class Predicate>
|
||||
TargetContainer sortedDerived(Predicate p) const
|
||||
{
|
||||
CSequence result = *this;
|
||||
result.sort(p);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Return a copy as derived container sorted by a given comparator predicate.
|
||||
* \remarks Sorts in background.
|
||||
@@ -510,7 +499,12 @@ namespace BlackMisc
|
||||
template <class TargetContainer, class Predicate>
|
||||
QFuture<TargetContainer> sortedAsync(Predicate p) const
|
||||
{
|
||||
QFuture<TargetContainer> f = QtConcurrent::run(this, &CSequence::sortedDerived<TargetContainer, Predicate>, p);
|
||||
TargetContainer result = *this;
|
||||
QFuture<TargetContainer> f = QtConcurrent::run([=]()
|
||||
{
|
||||
result.sort(p);
|
||||
return result;
|
||||
});
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user