Skip to content

Commit 19d3cc1

Browse files
authored
Merge pull request #245 from donpellegrino/244-remove-hash-map
244 remove hash map
2 parents 684a3b6 + 1e8b4b4 commit 19d3cc1

1 file changed

Lines changed: 1 addition & 35 deletions

File tree

libhdt/src/dictionary/PlainDictionary.hpp

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,7 @@
4141
#include <algorithm>
4242
#include <fstream>
4343
#include <iostream>
44-
45-
#ifndef WIN32
46-
#include <ext/hash_map>
47-
#else
4844
#include <unordered_map>
49-
#endif
50-
51-
//#define GOOGLE_HASH
52-
53-
#ifdef GOOGLE_HASH
54-
#include <sparsehash/sparse_hash_map>
55-
56-
using google::sparse_hash_map; // namespace where class lives by default
57-
using __gnu_cxx::hash; // or __gnu_cxx::hash, or maybe tr1::hash, depending on your OS
58-
59-
#else
60-
61-
#ifndef WIN32
62-
namespace std { using namespace __gnu_cxx; }
63-
#endif
64-
65-
#endif
66-
6745

6846
namespace hdt {
6947

@@ -84,22 +62,10 @@ struct str_cmp {
8462

8563
typedef std::pair<const char*, DictionaryEntry *> DictEntryPair;
8664

87-
#ifdef GOOGLE_HASH
88-
typedef sparse_hash_map<const char *, DictionaryEntry *, hash<const char *>, str_cmp> DictEntryHash;
89-
#else
90-
91-
#ifdef WIN32
92-
/*typedef std::hash_map<const char *, DictionaryEntry *, hash<const char *>, str_cmp> DictEntryHash;*/
93-
typedef unordered_map<const char *, DictionaryEntry *, hash<const char *>, str_cmp> DictEntryHash;
94-
#else
95-
typedef std::hash_map<const char *, DictionaryEntry *, __gnu_cxx::hash<const char *>, str_cmp> DictEntryHash;
96-
97-
#endif
98-
#endif
65+
typedef std::unordered_map<const char *, DictionaryEntry *, hash<std::string>, str_cmp> DictEntryHash;
9966

10067
typedef DictEntryHash::const_iterator DictEntryIt;
10168

102-
10369
class PlainDictionary : public ModifiableDictionary {
10470
private:
10571
std::vector<DictionaryEntry*> predicates;

0 commit comments

Comments
 (0)