aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Module
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2018-01-23 21:29:58 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2018-01-23 21:29:58 +0100
commit517f65a7cc3e94b9c4ad574369a32c48e0a95be6 (patch)
tree5854e181ab57be4ce9c9d1972fddd65049ef8f26 /src/Text/Pandoc/Lua/Module
parent2e0bb773345f489798666ac3c2d96d3873fa82a3 (diff)
downloadpandoc-517f65a7cc3e94b9c4ad574369a32c48e0a95be6.tar.gz
Lua filters: store constructors in registry
Lua functions used to construct AST element values are stored in the Lua registry for quicker access. Getting a value from the registry is much faster than getting a global value (partly to idiosyncrasies of hslua); this change results in a considerable performance boost.
Diffstat (limited to 'src/Text/Pandoc/Lua/Module')
-rw-r--r--src/Text/Pandoc/Lua/Module/Pandoc.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs
index f458d4773..b9410a353 100644
--- a/src/Text/Pandoc/Lua/Module/Pandoc.hs
+++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs
@@ -82,7 +82,7 @@ readDoc content formatSpecOrNil = do
res <- liftIO $ runIO $ r def{ readerExtensions = es } (pack content)
case res of
Right pd -> (1 :: NumResults) <$ Lua.push pd -- success, push Pandoc
- Left s -> Lua.raiseError (show s) -- error while reading
+ Left s -> Lua.raiseError (show s) -- error while reading
_ -> Lua.raiseError "Only string formats are supported at the moment."
-- | Pipes input through a command.