From 4f6bfd84b2230fd933acb4fba1b4f9bb3f3b4d8b Mon Sep 17 00:00:00 2001 From: Oliver Marriott Date: Fri, 10 Sep 2021 03:58:54 +1000 Subject: [PATCH] S-expression S-implification --- fnl/hotpot/searcher/module.fnl | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fnl/hotpot/searcher/module.fnl b/fnl/hotpot/searcher/module.fnl index 4628631b..001539f5 100644 --- a/fnl/hotpot/searcher/module.fnl +++ b/fnl/hotpot/searcher/module.fnl @@ -153,14 +153,12 @@ ;; If stale or missing, complile and return a loader for the cached file ;; If the original modname was for a lua file, just return a loader for that. - ;; TODO unsure about this double nested form but if feels problematic - (match (. package :preload modname) - module module - nil (match (modname-to-path modname) - ;; modpath can be nil if no file is found for modname - nil nil - path (match (pcall create-loader! modname path) - (true loader) loader - (false errors) (create-error-loader modname path errors))))) + (or (. package :preload modname) + (match (modname-to-path modname) + ;; modpath can be nil if no file is found for modname + nil nil + path (match (pcall create-loader! modname path) + (true loader) loader + (false errors) (create-error-loader modname path errors))))) {: searcher}