Replace check for GNU internal hashmap with std unordered_map.

This commit is contained in:
Valient Gough 2015-06-17 22:59:34 -07:00
parent 98b2d50b40
commit 3b751dde57
2 changed files with 2 additions and 22 deletions

View File

@ -25,12 +25,8 @@
#include <memory>
#include <set>
#ifdef USE_HASHMAP
#include <ext/hash_map>
#else
#include <map>
#endif
#include <string>
#include <unordered_map>
#include "encfs.h"
#include "shared_ptr.h"
@ -90,12 +86,7 @@ class EncFS_Context {
Placeholder(const shared_ptr<FileNode> &ptr) : node(ptr) {}
};
#ifdef USE_HASHMAP
// set of open files, indexed by path
typedef __gnu_cxx::hash_map<std::string, std::set<Placeholder *> > FileMap;
#else
typedef std::map<std::string, std::set<Placeholder *> > FileMap;
#endif
typedef std::unordered_map<std::string, std::set<Placeholder *> > FileMap;
mutable pthread_mutex_t contextMutex;
FileMap openFiles;

View File

@ -76,17 +76,6 @@ class DirTraverse {
};
inline bool DirTraverse::valid() const { return dir.get() != 0; }
#ifdef USE_HASHMAP
namespace __gnu_cxx {
template <>
struct hash<std::string> {
size_t operator()(const std::string &__s) const {
return __stl_hash_string(__s.c_str());
}
};
}
#endif
class DirNode {
public:
// sourceDir points to where raw files are stored