summaryrefslogtreecommitdiffhomepage
path: root/grammer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'grammer.cpp')
-rw-r--r--grammer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/grammer.cpp b/grammer.cpp
index be01adc..2379e9a 100644
--- a/grammer.cpp
+++ b/grammer.cpp
@@ -365,9 +365,9 @@ void Compiler::TrackBack()
// breadth-first search
// return: node, child
-std::map<std::string, std::string> Compiler::traverse(const std::string& lower, const std::string& upper)
+std::unordered_map<std::string, std::string> Compiler::traverse(const std::string& lower, const std::string& upper)
{
- std::map<std::string, std::string> visited; // node, child
+ std::unordered_map<std::string, std::string> visited; // node, child
std::deque<std::pair<std::string, std::string>> todo{{lower, ""}}; // node, child
while (!todo.empty()) {
@@ -401,7 +401,7 @@ std::vector<std::string> Compiler::GetPath(std::string upper, std::string lower)
std::vector<std::string> result;
// traverse bnf from lower to upper
- std::map<std::string, std::string> visited {traverse(lower, upper)};
+ std::unordered_map<std::string, std::string> visited {traverse(lower, upper)};
auto current {upper};
while (current != lower) {