effects/private: Nuke an unnecessary loop
Yes, Marco, there is a more efficient way.
This commit is contained in:
parent
d3a5a72a46
commit
1f0a0c893a
1 changed files with 1 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue