Kaydet (Commit) 55783b80 authored tarafından Noel Grandin's avatar Noel Grandin

std::string has a std::hash specialisation since C++11

Change-Id: I8cc01420d0235a8d1686881eca1ad9cc4a67ebe0
Reviewed-on: https://gerrit.libreoffice.org/70362
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e967aea2
......@@ -126,34 +126,11 @@ namespace fs
void copy(const fs::path &src, const fs::path &dest);
}
struct joaat_hash
{
size_t operator()(const std::string &str) const
{
size_t hash = 0;
const char *key = str.data();
for (size_t i = 0; i < str.size(); i++)
{
hash += key[i];
hash += (hash << 10);
hash ^= (hash >> 6);
}
hash += (hash << 3);
hash ^= (hash >> 11);
hash += (hash << 15);
return hash;
}
};
#define get16bits(d) ((((sal_uInt32)(((const sal_uInt8 *)(d))[1])) << 8)\
+(sal_uInt32)(((const sal_uInt8 *)(d))[0]) )
#define pref_hash joaat_hash
typedef std::unordered_map<std::string, std::string, pref_hash> Stringtable;
typedef std::unordered_map<std::string, std::string> Stringtable;
typedef std::deque<std::string> LinkedList;
typedef std::unordered_map<std::string, LinkedList, pref_hash> Hashtable;
typedef std::unordered_map<std::string, LinkedList> Hashtable;
class StreamTable
{
......
......@@ -173,7 +173,7 @@ static void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const
class HelpKeyword
{
private:
typedef std::unordered_map<std::string, Data, pref_hash> DataHashtable;
typedef std::unordered_map<std::string, Data> DataHashtable;
DataHashtable _hash;
public:
......
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