Verified Commit bd4e4013 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

effects/private: Nuke an unnecessary loop

Yes, Marco, there is a more efficient way.

(cherry picked from commit 1f0a0c89)
parent 30de75a9
......@@ -41,16 +41,7 @@ bool QuickSceneEffectPrivate::isItemOnScreen(QQuickItem *item, EffectScreen *scr
}
const QuickSceneView *view = views[screen];
auto *rootItem = view->rootItem();
auto candidate = item->parentItem();
// Is there a more efficient way?
while (candidate) {
if (candidate == rootItem) {
return true;
}
candidate = candidate->parentItem();
}
return false;
return item->window() == view->window();
}
QuickSceneView::QuickSceneView(QuickSceneEffect *effect, EffectScreen *screen)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment