From d4e126932bd022c2797e1a7006e03eead2ba6df4 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 2 Oct 2014 16:21:14 +0200 Subject: [PATCH] Fixes of review included (Concurrency 2, https://dev.vatsim-germany.org/issues/325#note-14) --- src/blackmisc/sequence.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index 02ad7e214..6c650d805 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -492,17 +492,6 @@ namespace BlackMisc return result; } - /*! - * \brief Return a copy as derived container sorted by a given comparator predicate. - */ - template - 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 QFuture sortedAsync(Predicate p) const { - QFuture f = QtConcurrent::run(this, &CSequence::sortedDerived, p); + TargetContainer result = *this; + QFuture f = QtConcurrent::run([=]() + { + result.sort(p); + return result; + }); return f; }