git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: small efficiency improvement.
commitae51de3b3d5835e1821b902a665096e41b6db11b authorJohn MacFarlane <jgm@berkeley.edu> dateMon 15 Oct 2018, 15:54 (8 years ago) parent1db5856
1 file changed+2−1
src/Text/Pandoc/Readers/LaTeX/Parsing.hs+2−1
src/Text/Pandoc/Readers/LaTeX/Parsing.hs+2−1
@@ -375,8 +375,9 @@ toksToString = T.unpack . untokenize
375375satisfyTok :: PandocMonad m => (Tok -> Bool) -> LP m Tok
376376satisfyTok f = do
377377 doMacros -- apply macros on remaining input stream
378+ res <- tokenPrim (T.unpack . untoken) updatePos matcher
378379 updateState $ \st -> st{ sExpanded = False }
379− tokenPrim (T.unpack . untoken) updatePos matcher
380+ return res
380381 where matcher t | f t = Just t
381382 | otherwise = Nothing
382383 updatePos :: SourcePos -> Tok -> [Tok] -> SourcePos