From 81d851f6aa735821fba041750b3a0cb1ca0e7d56 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Mon, 9 Jul 2018 15:36:27 +0300 Subject: [PATCH] [libkwineffects] Use std::copy Summary: Don't use raw loop, use an algorithm from STL to copy effect pairs. Test Plan: Effects are still working. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14004 --- effects.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/effects.cpp b/effects.cpp index c01d8862ef..4b833bf5ee 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1417,11 +1417,11 @@ void EffectsHandlerImpl::effectsChanged() { loaded_effects.clear(); m_activeEffects.clear(); // it's possible to have a reconfigure and a quad rebuild between two paint cycles - bug #308201 -// qDebug() << "Recreating effects' list:"; - for (const EffectPair & effect : effect_order) { -// qDebug() << effect.first; - loaded_effects.append(effect); - } + + loaded_effects.reserve(effect_order.count()); + std::copy(effect_order.constBegin(), effect_order.constEnd(), + std::back_inserter(loaded_effects)); + m_activeEffects.reserve(loaded_effects.count()); }