summaryrefslogtreecommitdiffhomepage
path: root/grammer.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-03-31 12:03:53 +0200
committerRoland Reichwein <mail@reichwein.it>2020-03-31 12:03:53 +0200
commit3c8e6cc25e414fed9dbaadef6fed9cc7efaf3068 (patch)
treeaace36c9d6ac0302f188f02be55050c82617fbe3 /grammer.h
parent79fbc8bf495770e4a8b7c66c46acf07f4e47e568 (diff)
Optimize start lookup
Diffstat (limited to 'grammer.h')
-rw-r--r--grammer.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/grammer.h b/grammer.h
index df7ff8d..9b72d3a 100644
--- a/grammer.h
+++ b/grammer.h
@@ -81,8 +81,7 @@ private:
return h0 ^ (h1 << 1) ^ (h2 << 2);
}
};
- std::unordered_set<std::tuple<std::string, size_t, std::string>, TupleHash> m_start_cache;
- bool canStartWith(const std::string& non_terminal, size_t variant, const std::string& terminal) const;
+ std::unordered_map<std::pair<std::string, std::string>, std::vector<size_t>, PairHashSS> m_match_lut;
void fillStartCache();
void constructTree();