Use reference on a const loop var to avoid copy

Clang 10 warns that ``s`` might be copied. Use a reference to avoid copying
This commit is contained in:
Power Snail 2020-03-06 21:43:20 +00:00 committed by John Maguire
parent b762987cd6
commit 4fe845c2c5
1 changed files with 1 additions and 1 deletions

View File

@ -286,7 +286,7 @@ void PlaylistListContainer::AddPlaylist(int id, const QString& name,
QStandardItem* playlist_item = model_->NewPlaylist(name, id);
QStandardItem* parent_folder = model_->FolderByPath(*ui_path);
parent_folder->appendRow(playlist_item);
for (const Song s : app_->playlist_backend()->GetPlaylistSongs(id)) {
for (const Song& s : app_->playlist_backend()->GetPlaylistSongs(id)) {
QStandardItem* track_item = model_->NewTrack(s);
track_item->setDragEnabled(false);
playlist_item->appendRow(track_item);