Skip to content

Commit

Permalink
fix iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jun 21, 2023
1 parent 30bfe9e commit 696a71b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/library/coverartdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ void CoverArtDelegate::emitRowsChanged(
// Sort in ascending order...
std::sort(rows.begin(), rows.end());
// ...and then deduplicate...
rows.erase(std::unique(rows.begin(), rows.end()), rows.end());
rows.erase(
QList<int>::const_iterator(std::unique(rows.begin(), rows.end())),
rows.constEnd());
// ...before emitting the signal.
DEBUG_ASSERT(!rows.isEmpty());
emit rowsChanged(std::move(rows));
Expand Down
4 changes: 2 additions & 2 deletions src/library/dao/playlistdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ void PlaylistDAO::deletePlaylist(const int playlistId) {
transaction.commit();
//TODO: Crap, we need to shuffle the positions of all the playlists?

for (QMultiHash<TrackId, int>::iterator it = m_playlistsTrackIsIn.constBegin();
for (auto it = m_playlistsTrackIsIn.constBegin();
it != m_playlistsTrackIsIn.constEnd();) {
if (it.value() == playlistId) {
it = m_playlistsTrackIsIn.erase(it);
it = QMultiHash<TrackId, int>::const_iterator(m_playlistsTrackIsIn.erase(it));
} else {
++it;
}
Expand Down

0 comments on commit 696a71b

Please sign in to comment.