Always use unordered map/set

master
Unknown 2018-04-08 07:55:19 +02:00
parent 0292669a5e
commit 467e7cea54
3 changed files with 3 additions and 27 deletions

View File

@ -14,11 +14,7 @@
#include <climits>
#include <iosfwd>
#include <list>
#if __cplusplus >= 201103L
#include <unordered_map>
#else
#include <map>
#endif
#include <set>
#include <list>
#include <cstdint>
@ -61,13 +57,9 @@
class TileGenerator
{
private:
#if __cplusplus >= 201103L
typedef std::unordered_map<std::string, ColorEntry> NodeColorMap;
typedef std::unordered_map<int, std::string> NodeID2NameMap;
#else
typedef std::map<std::string, ColorEntry> NodeColorMap;
typedef std::map<int, std::string> NodeID2NameMap;
#endif
public:
struct HeightMapColor
{

View File

@ -6,22 +6,15 @@
#include "db.h"
#include <libpq-fe.h>
#if __cplusplus >= 201103L
#include <unordered_map>
#else
#include <map>
#endif
#include <string>
#include <sstream>
#include "types.h"
class DBPostgreSQL : public DB {
#if __cplusplus >= 201103L
typedef std::unordered_map<int64_t, ustring> BlockCache;
#else
typedef std::map<int64_t, ustring> BlockCache;
#endif
public:
DBPostgreSQL(const std::string &mapdir);
virtual int getBlocksQueriedCount(void);

View File

@ -5,25 +5,16 @@
#include "db.h"
#include <sqlite3.h>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#else
#include <map>
#include <set>
#endif
#include <string>
#include <sstream>
class DBSQLite3 : public DB {
#if __cplusplus >= 201103L
typedef std::unordered_map<int64_t, std::vector<unsigned char>> BlockCache;
typedef std::unordered_set<int64_t> BlockIdSet;
#else
typedef std::map<int64_t, std::vector<unsigned char>> BlockCache;
typedef std::set<int64_t> BlockIdSet;
#endif
public:
DBSQLite3(const std::string &mapdir);
virtual int getBlocksQueriedCount(void);