Skip to content

Commit

Permalink
Tidy up loading of lfs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Nov 21, 2024
1 parent 8c17120 commit 513cd87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions l3build-ctan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ for those people who are interested.
--]]

local lfs = require("lfs")

local pairs = pairs
local print = print

Expand Down
2 changes: 2 additions & 0 deletions l3build-file-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ for those people who are interested.
--]]

local lfs = require("lfs")

local print = print

local open = io.open
Expand Down
2 changes: 2 additions & 0 deletions l3build-upload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ for those people who are interested.
--]]

local lfs = require("lfs")

local pairs = pairs
local print = print
local tostring = tostring
Expand Down

2 comments on commit 513cd87

@muzimuzhi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't lfs available out-of-the-box in LuaTeX/texlua? Or does the local table defined by local lfs = require("lfs") works quicker?

@josephwright
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but like \RequirePackage{...} in LaTeX, we are making it clear what the dependency is here. Also, a local copy is a little faster than using the global.

Please sign in to comment.