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

@@ -30,13 +30,13 @@
#include "utility/wide_string.h"
#include "window.h"
namespace {//
namespace {
size_t calc_hash(const char* s, unsigned seed = 0)
{
size_t hash = seed;
while (*s)
hash = hash * 101 + *s++;
hash = hash * 101 + *s++;
return hash;
}
@@ -211,12 +211,6 @@ std::string MPD::Song::getTags(GetFunction f, const std::string &tags_separator)
return result;
}
unsigned Song::getHash() const
{
assert(m_song);
return m_hash;
}
unsigned Song::getDuration() const
{
assert(m_song);