[effects/blur] Lookup window once when disconnecting from blurChanged

Summary:
When disconnecting from `blurChanged` signal, `(w, connection)` pair is
being looked up three times. We can do better by using `QMap` in a more
STL-like way.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13118
icc-effect-5.14.5
Vlad Zagorodniy 2018-05-25 19:49:44 +03:00
parent 54b69bec44
commit 95ee052442
1 changed files with 5 additions and 3 deletions

View File

@ -303,10 +303,12 @@ void BlurEffect::slotWindowAdded(EffectWindow *w)
void BlurEffect::slotWindowDeleted(EffectWindow *w)
{
if (windowBlurChangedConnections.contains(w)) {
disconnect(windowBlurChangedConnections[w]);
windowBlurChangedConnections.remove(w);
auto it = windowBlurChangedConnections.find(w);
if (it == windowBlurChangedConnections.end()) {
return;
}
disconnect(*it);
windowBlurChangedConnections.erase(it);
}
void BlurEffect::slotPropertyNotify(EffectWindow *w, long atom)