mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-31 01:29:41 +01:00
Replace while with for loop
This commit is contained in:
parent
062c59b321
commit
20a15ecd35
@ -568,13 +568,12 @@ void CollectionModel::SongsDeleted(const SongList &songs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove from pending art loading
|
// Remove from pending art loading
|
||||||
QMap<quint64, ItemAndCacheKey>::iterator i = pending_art_.begin();
|
for (QMap<quint64, ItemAndCacheKey>::iterator it = pending_art_.begin() ; it != pending_art_.end();) {
|
||||||
while (i != pending_art_.end()) {
|
if (it.value().first == node) {
|
||||||
if (i.value().first == node) {
|
it = pending_art_.erase(it); // clazy:exclude=strict-iterators
|
||||||
i = pending_art_.erase(i); // clazy:exclude=strict-iterators
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
++i;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,11 +314,9 @@ void ContextAlbumsModel::LazyPopulate(CollectionItem *parent, const bool signal)
|
|||||||
|
|
||||||
void ContextAlbumsModel::Reset() {
|
void ContextAlbumsModel::Reset() {
|
||||||
|
|
||||||
QMap<QString, CollectionItem*>::iterator i = container_nodes_.begin();
|
for (QMap<QString, CollectionItem*>::const_iterator it = container_nodes_.begin() ; it != container_nodes_.end(); ++it) {
|
||||||
while (i != container_nodes_.end()) {
|
const QString cache_key = AlbumIconPixmapCacheKey(ItemToIndex(it.value()));
|
||||||
const QString cache_key = AlbumIconPixmapCacheKey(ItemToIndex(i.value()));
|
|
||||||
QPixmapCache::remove(cache_key);
|
QPixmapCache::remove(cache_key);
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user