song: use boost::hash

This commit is contained in:
Andrzej Rybczak
2015-04-18 22:46:42 +02:00
parent 7f9f055082
commit 9e85f38865
2 changed files with 12 additions and 11 deletions

View File

@@ -21,6 +21,7 @@
#include <cassert>
#include <cstring>
#include <boost/format.hpp>
#include <boost/functional/hash.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <memory>
@@ -32,12 +33,11 @@
namespace {
size_t calc_hash(const char* s, unsigned seed = 0)
size_t calc_hash(const char *s, size_t seed = 0)
{
size_t hash = seed;
while (*s)
hash = hash * 101 + *s++;
return hash;
for (; *s != '\0'; ++s)
boost::hash_combine(seed, *s);
return seed;
}
}