diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-04-02 11:00:28 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-04-02 11:00:44 -0700 |
| commit | f406f93daba6c7113f6663216a7144feecee3f39 (patch) | |
| tree | a58048548f9738cfb81dea9e5c0b1218016182c3 /src | |
| parent | 7ac72fd54996870b72262c8017d56274d654c962 (diff) | |
LaTeX reader: avoid a thunk in sRawTokens.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index bf1ebbb9c..8d7181689 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE BangPatterns #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -504,7 +505,9 @@ satisfyTok f = do res <- tokenPrim (T.unpack . untoken) updatePos matcher updateState $ \st -> if sEnableWithRaw st - then st{ sRawTokens = IntMap.map (res:) $ sRawTokens st } + then + let !newraws = IntMap.map (res:) $! sRawTokens st + in st{ sRawTokens = newraws } else st return $! res where matcher t | f t = Just t |
