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

@@ -224,10 +224,7 @@ void SearchEngine::EnterPressed()
reset();
}
else
{
bool res = myPlaylist->Add(w->current().value().song(), w->current().isBold(), 1);
w->current().setBold(res);
}
myPlaylist->Add(w->current().value().song(), 1);
if (option < SearchButton)
UnlockStatusbar();
@@ -245,8 +242,7 @@ void SearchEngine::SpacePressed()
return;
}
bool res = myPlaylist->Add(w->current().value().song(), w->current().isBold(), 0);
w->current().setBold(res);
myPlaylist->Add(w->current().value().song(), 0);
w->scroll(NC::wDown);
}