From 55783b8006a509dbdfe29a1bd5d86f26204b6a42 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 7 Apr 2019 09:13:30 +0200 Subject: 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: Noel Grandin --- helpcompiler/inc/HelpCompiler.hxx | 27 ++------------------------- helpcompiler/source/HelpLinker.cxx | 2 +- 2 files changed, 3 insertions(+), 26 deletions(-) (limited to 'helpcompiler') diff --git a/helpcompiler/inc/HelpCompiler.hxx b/helpcompiler/inc/HelpCompiler.hxx index 06521c97256e..ecd54ede9d0f 100644 --- a/helpcompiler/inc/HelpCompiler.hxx +++ b/helpcompiler/inc/HelpCompiler.hxx @@ -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 Stringtable; +typedef std::unordered_map Stringtable; typedef std::deque LinkedList; -typedef std::unordered_map Hashtable; +typedef std::unordered_map Hashtable; class StreamTable { diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index 86d2d254bef2..f32e242f0867 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -173,7 +173,7 @@ static void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const class HelpKeyword { private: - typedef std::unordered_map DataHashtable; + typedef std::unordered_map DataHashtable; DataHashtable _hash; public: -- cgit v1.2.3