From f9460b88d7fed4387911e78ace8f5f5a98cc88f3 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 24 Sep 2023 01:59:26 -0400 Subject: [PATCH] Add a TODO for a performance optimization. --- src/parser/element_parser.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index 92da53c..e847da5 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -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) }