GWidget: Remove unnecessary extra parent lookup in move_to_{back,front}().

This commit is contained in:
Andreas Kling 2019-04-16 04:01:14 +02:00
parent 52e846df87
commit c812d63ea6
Notes: sideshowbarker 2024-07-19 14:41:20 +09:00

View file

@ -450,9 +450,11 @@ void GWidget::move_to_front()
return;
if (parent->children().size() == 1)
return;
parent->children().remove_first_matching([this] (auto& entry) { return entry == this; });
parent->children().remove_first_matching([this] (auto& entry) {
return entry == this;
});
parent->children().append(this);
parent_widget()->update();
parent->update();
}
void GWidget::move_to_back()
@ -462,9 +464,11 @@ void GWidget::move_to_back()
return;
if (parent->children().size() == 1)
return;
parent->children().remove_first_matching([this] (auto& entry) { return entry == this; });
parent->children().remove_first_matching([this] (auto& entry) {
return entry == this;
});
parent->children().prepend(this);
parent_widget()->update();
parent->update();
}
bool GWidget::is_frontmost() const