diff --git a/effects.cpp b/effects.cpp index 3577535bd1..a4ad2010b5 100644 --- a/effects.cpp +++ b/effects.cpp @@ -488,6 +488,7 @@ bool EffectsHandlerImpl::decorationSupportsBlurBehind() const void EffectsHandlerImpl::startPaint() { m_activeEffects.clear(); + m_activeEffects.reserve(loaded_effects.count()); for(QVector< KWin::EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if (it->second->isActive()) { m_activeEffects << it->second; @@ -1552,6 +1553,7 @@ void EffectsHandlerImpl::effectsChanged() // kDebug(1212) << effect.first; loaded_effects.append(effect); } + m_activeEffects.reserve(loaded_effects.count()); } QStringList EffectsHandlerImpl::activeEffects() const diff --git a/effects.h b/effects.h index 1850089499..43f2c14642 100644 --- a/effects.h +++ b/effects.h @@ -253,9 +253,9 @@ private Q_SLOTS: void slotEffectsQueried(); private: - QList< Effect* > m_activeEffects; - typedef QList< Effect*> EffectsList; + typedef QVector< Effect*> EffectsList; typedef EffectsList::const_iterator EffectsIterator; + EffectsList m_activeEffects; EffectsIterator m_currentDrawWindowIterator; EffectsIterator m_currentPaintWindowIterator; EffectsIterator m_currentPaintEffectFrameIterator;