check if song is in playlist in O(nlogn) instead of O(n^2)

This commit is contained in:
Andrzej Rybczak
2012-09-04 03:12:37 +02:00
parent 8ab8da2a30
commit 60ca9de919
7 changed files with 50 additions and 51 deletions

View File

@@ -802,10 +802,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
void MediaLibrary::AddToPlaylist(bool add_n_play)
{
if (w == Songs && !Songs->empty())
{
bool res = myPlaylist->Add(Songs->current().value(), Songs->current().isBold(), add_n_play);
Songs->current().setBold(res);
}
myPlaylist->Add(Songs->current().value(), add_n_play);
else
{
auto list = getSelectedSongs();