mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2024-12-14 09:44:51 +01:00
Simplify return
This commit is contained in:
parent
c1c34017e4
commit
75b6669371
@ -236,10 +236,7 @@ class OrFilter : public FilterTree {
|
||||
~OrFilter() override { qDeleteAll(children_); }
|
||||
virtual void add(FilterTree *child) { children_.append(child); }
|
||||
bool accept(int row, const QModelIndex &parent, const QAbstractItemModel *const model) const override {
|
||||
if (std::any_of(children_.begin(), children_.end(), [row, parent, model](FilterTree *child) { return child->accept(row, parent, model); })) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return std::any_of(children_.begin(), children_.end(), [row, parent, model](FilterTree *child) { return child->accept(row, parent, model); });
|
||||
}
|
||||
FilterType type() override { return Or; }
|
||||
private:
|
||||
@ -251,10 +248,7 @@ class AndFilter : public FilterTree {
|
||||
~AndFilter() override { qDeleteAll(children_); }
|
||||
virtual void add(FilterTree *child) { children_.append(child); }
|
||||
bool accept(int row, const QModelIndex &parent, const QAbstractItemModel *const model) const override {
|
||||
if (std::any_of(children_.begin(), children_.end(), [row, parent, model](FilterTree *child) { return !child->accept(row, parent, model); })) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !std::any_of(children_.begin(), children_.end(), [row, parent, model](FilterTree *child) { return !child->accept(row, parent, model); });
|
||||
}
|
||||
FilterType type() override { return And; }
|
||||
private:
|
||||
|
@ -56,12 +56,7 @@ class SmartPlaylistQueryWizardPlugin::SearchPage : public QWizardPage { // claz
|
||||
if (ui_->type->currentIndex() == 2) { // All songs
|
||||
return true;
|
||||
}
|
||||
|
||||
if (std::any_of(terms_.begin(), terms_.end(), [](SmartPlaylistSearchTermWidget *widget) { return !widget->Term().is_valid(); })) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return !std::any_of(terms_.begin(), terms_.end(), [](SmartPlaylistSearchTermWidget *widget) { return !widget->Term().is_valid(); });
|
||||
}
|
||||
|
||||
QVBoxLayout *layout_;
|
||||
|
Loading…
Reference in New Issue
Block a user