From 1a2c5de357d8d3c15d3c27830e91cc8bea5a4b2f Mon Sep 17 00:00:00 2001 From: llocram Date: Fri, 28 Aug 2020 14:09:16 +0200 Subject: [PATCH] Replaced hand-crafted reverse algorithm with std::reverse --- src/libs/vlayout/vlayoutpiece.cpp | 15 +++------------ src/libs/vmisc/compatibility.h | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 6a9f61a98..c6d79c4da 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -508,20 +508,11 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, vidtype id, const VContai template QVector VLayoutPiece::Map(QVector points) const { - for (int i = 0; i < points.size(); ++i) - { - points[i] = d->matrix.map(points.at(i)); - } - + std::transform(points.begin(), points.end(), points.begin(), + [this](const auto &point) { return d->matrix.map(point); }); if (d->mirror) { - QList list = ConvertToList(points); - - for (int k=0, s=list.size(), max=(s/2); k ConvertToVector(const QSet &container) } //--------------------------------------------------------------------------------------------------------------------- -template -inline void SwapItemsAt(T &container, int i, int j) -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) - container.swapItemsAt(i, j); -#else - container.swap(i, j); -#endif -} +// NOTE: Delete if not necessary anymore +//template +//inline void SwapItemsAt(T &container, int i, int j) +//{ +//#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) +// container.swapItemsAt(i, j); +//#else +// container.swap(i, j); +//#endif +//} //--------------------------------------------------------------------------------------------------------------------- template