feat: use unordered_map instead of map
parent
8ca68b0e9a
commit
3f3ad0c765
|
@ -3,11 +3,11 @@
|
||||||
#include "finder.h"
|
#include "finder.h"
|
||||||
#include "word_list.h"
|
#include "word_list.h"
|
||||||
|
|
||||||
#include <map>
|
#include <unordered_map>
|
||||||
|
|
||||||
class Bucket {
|
class Bucket {
|
||||||
private:
|
private:
|
||||||
std::map<char, WordRefList> directory_;
|
std::unordered_map<char, WordRefList> directory_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void insert(const WordList &word_list, size_t first_index, size_t last_index);
|
void insert(const WordList &word_list, size_t first_index, size_t last_index);
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
#include "finder.h"
|
#include "finder.h"
|
||||||
#include "word_list.h"
|
#include "word_list.h"
|
||||||
|
|
||||||
#include <map>
|
#include <unordered_map>
|
||||||
|
|
||||||
class GroupedFinder : public Finder {
|
class GroupedFinder : public Finder {
|
||||||
private:
|
private:
|
||||||
std::map<char, WordRefList> groups_;
|
std::unordered_map<char, WordRefList> groups_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GroupedFinder(const WordList &word_list);
|
GroupedFinder(const WordList &word_list);
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
#include "finder.h"
|
#include "finder.h"
|
||||||
#include "word_list.h"
|
#include "word_list.h"
|
||||||
|
|
||||||
#include <map>
|
#include <unordered_map>
|
||||||
|
|
||||||
class SearchTreeNode {
|
class SearchTreeNode {
|
||||||
private:
|
private:
|
||||||
WordRefList words_;
|
WordRefList words_;
|
||||||
std::map<const char, SearchTreeNode> children_;
|
std::unordered_map<char, SearchTreeNode> children_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void insert(std::string_view partial_word, const std::string *original_word);
|
void insert(std::string_view partial_word, const std::string *original_word);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "grouped_finder.h"
|
#include "grouped_finder.h"
|
||||||
|
|
||||||
#include <forward_list>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
Loading…
Reference in New Issue