From ae51de3b3d5835e1821b902a665096e41b6db11b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 Oct 2018 15:54:33 -0700 Subject: LaTeX reader: small efficiency improvement. --- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 40853c5d0..b3945c372 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -375,8 +375,9 @@ toksToString = T.unpack . untokenize satisfyTok :: PandocMonad m => (Tok -> Bool) -> LP m Tok satisfyTok f = do doMacros -- apply macros on remaining input stream + res <- tokenPrim (T.unpack . untoken) updatePos matcher updateState $ \st -> st{ sExpanded = False } - tokenPrim (T.unpack . untoken) updatePos matcher + return res where matcher t | f t = Just t | otherwise = Nothing updatePos :: SourcePos -> Tok -> [Tok] -> SourcePos -- cgit v1.2.3