Commit 5bdf93ef authored by Davis King's avatar Davis King

Switched the default hash function for std::strings (when used with hash tables)

to dlib::hash().
parent 6335f110
......@@ -5,6 +5,7 @@
#include <string>
#include "hash.h"
namespace dlib
{
......@@ -68,11 +69,7 @@ namespace dlib
const std::string& item
) const
{
unsigned long hash = 0;
std::string::size_type size = item.size();
for (std::string::size_type i = 0; i < size; ++i)
hash = hash*37 + static_cast<unsigned long>(item[i]);
return hash;
return hash(item);
}
// ----------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment