diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2013-09-12 13:25:38 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-13 11:47:06 +0200 |
commit | 12bd604f241d41d52ab3fde9f4a8f4f5c2f3fa6d (patch) | |
tree | 3fdcf02338a8a5c581bd72c956bbf6d2e776a07d /src | |
parent | 16a52882e7b64bfa962fec365a0d1b341d038f39 (diff) |
QtConcurrent::Median: add some qMove()
In case this code is ever instantiated with a type that actually benefits from moving.
'value' is save to move since it was passed to the function by value.
'*mid' is save to move since it originates in a container that will be
discarded on the next line anyway.
Change-Id: I13587be10974ba6cf95d56e0f8912ff88167b60b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/concurrent/qtconcurrentmedian.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h index b39b3ed32b..29342e6402 100644 --- a/src/concurrent/qtconcurrentmedian.h +++ b/src/concurrent/qtconcurrentmedian.h @@ -90,7 +90,7 @@ public: dirty = true; } - values[currentIndex] = value; + values[currentIndex] = qMove(value); } bool isMedianValid() const @@ -105,7 +105,7 @@ public: QVector<T> copy = values; typename QVector<T>::iterator begin = copy.begin(), mid = copy.begin() + bufferSize/2, end = copy.end(); std::nth_element(begin, mid, end); - currentMedian = *mid; + currentMedian = qMove(*mid); } return currentMedian; } |