CollectionModel: Change while to for loop

This commit is contained in:
Jonas Kvinge 2023-01-07 23:26:36 +01:00
parent 2c302654b7
commit e97be5850b

View File

@ -845,10 +845,8 @@ CollectionModel::QueryResult CollectionModel::RunQuery(CollectionItem *parent) {
InitQuery(child_group_by, separate_albums_by_grouping_, &q); InitQuery(child_group_by, separate_albums_by_grouping_, &q);
// Walk up through the item's parents adding filters as necessary // Walk up through the item's parents adding filters as necessary
CollectionItem *p = parent; for (CollectionItem *p = parent; p && p->type == CollectionItem::Type_Container; p = p->parent) {
while (p && p->type == CollectionItem::Type_Container) {
FilterQuery(group_by_[p->container_level], separate_albums_by_grouping_, p, &q); FilterQuery(group_by_[p->container_level], separate_albums_by_grouping_, p, &q);
p = p->parent;
} }
// Artists GroupBy is special - we don't want compilation albums appearing // Artists GroupBy is special - we don't want compilation albums appearing