slightly easier to understand

A comment is now in a better place.

Inlining an unnecessary function boundary removes ambiguity between the
similar names load_all and load_files_so_far. It also shrinks call
stacks on error.
This commit is contained in:
Kartik K. Agaram 2023-06-19 09:59:17 -07:00
parent d486f94a4b
commit 3fdd0d339c
1 changed files with 3 additions and 5 deletions

View File

@ -57,7 +57,8 @@ function live.load_files_so_far()
end
end
end
-- load files from save dir
-- list files to load in save dir
-- (ignore the repo because we might have deleted definitions)
for _,filename in ipairs(love.filesystem.getDirectoryItems('')) do
if io.open(love.filesystem.getSaveDirectory()..'/'..filename) then
local numeric_prefix, root = filename:match('^(%d+)-(.+)')
@ -69,10 +70,7 @@ function live.load_files_so_far()
end
end
table.sort(Live.filenames_to_load)
live.load_all()
end
function live.load_all()
-- load files from save dir
for _,filename in ipairs(Live.filenames_to_load) do
--? print('loading', filename)
local buf = love.filesystem.read(filename)