playlist: make kept song count collision resistant

This commit is contained in:
Andrzej Rybczak
2014-08-30 02:30:54 +02:00
parent d20765c53a
commit dcaa1cafa4
8 changed files with 37 additions and 38 deletions

View File

@@ -980,11 +980,11 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
if (Songs.empty())
update();
if (s.getHash() != Songs.current().value().getHash())
if (s != Songs.current().value())
{
for (size_t i = 0; i < Songs.size(); ++i)
{
if (s.getHash() == Songs[i].value().getHash())
if (s == Songs[i].value())
{
Songs.highlight(i);
break;