1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-28 08:09:40 +01:00

PlaylistListModel: Use const_iterator

This commit is contained in:
Jonas Kvinge 2024-09-07 15:35:09 +02:00
parent f642513587
commit 48bb5a3e9f

View File

@ -133,8 +133,8 @@ void PlaylistListModel::RowsAboutToBeRemoved(const QModelIndex &parent, const in
switch (idx.data(Role_Type).toInt()) {
case Type_Playlist:{
const int id = idx.data(Role_PlaylistId).toInt();
QMap<int, QStandardItem*>::iterator it = playlists_by_id_.find(id);
if (it != playlists_by_id_.end() && it.value() == item) {
QMap<int, QStandardItem*>::const_iterator it = playlists_by_id_.constFind(id);
if (it != playlists_by_id_.constEnd() && it.value() == item) {
playlists_by_id_.erase(it);
}
break;