feat: use unordered_map instead of map

This commit is contained in:
Michael Mandl 2024-03-22 15:37:13 +01:00
parent 8ca68b0e9a
commit 3f3ad0c765
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
4 changed files with 6 additions and 7 deletions

View file

@ -3,11 +3,11 @@
#include "finder.h"
#include "word_list.h"
#include <map>
#include <unordered_map>
class Bucket {
private:
std::map<char, WordRefList> directory_;
std::unordered_map<char, WordRefList> directory_;
public:
void insert(const WordList &word_list, size_t first_index, size_t last_index);

View file

@ -3,11 +3,11 @@
#include "finder.h"
#include "word_list.h"
#include <map>
#include <unordered_map>
class GroupedFinder : public Finder {
private:
std::map<char, WordRefList> groups_;
std::unordered_map<char, WordRefList> groups_;
public:
GroupedFinder(const WordList &word_list);

View file

@ -3,12 +3,12 @@
#include "finder.h"
#include "word_list.h"
#include <map>
#include <unordered_map>
class SearchTreeNode {
private:
WordRefList words_;
std::map<const char, SearchTreeNode> children_;
std::unordered_map<char, SearchTreeNode> children_;
public:
void insert(std::string_view partial_word, const std::string *original_word);

View file

@ -1,6 +1,5 @@
#include "grouped_finder.h"
#include <forward_list>
#include <mutex>
#include <thread>
#include <vector>