effects/private: Nuke an unnecessary loop

Yes, Marco, there is a more efficient way.
This commit is contained in:
ivan tkachenko 2022-09-16 01:23:48 +03:00
parent d3a5a72a46
commit 1f0a0c893a
No known key found for this signature in database
GPG key ID: AF72731B7C654CB3

View file

@ -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)