Add a TODO for a performance optimization.

This commit is contained in:
Tom Alexander 2023-09-24 01:59:26 -04:00
parent 0b2a5f4fbf
commit f9460b88d7
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 1 additions and 0 deletions

View File

@ -107,6 +107,7 @@ fn _element<'b, 'g, 'r, 's>(
match map(paragraph_matcher, Element::Paragraph)(remaining) {
the_ok @ Ok(_) => the_ok,
Err(_) => {
// TODO: Because this function expects a single element, if there are multiple affiliated keywords before an element that cannot have affiliated keywords, we end up re-parsing the affiliated keywords many times.
affiliated_keywords.clear();
map(affiliated_keyword_matcher, Element::Keyword)(input)
}