[chore] FileChooser: "traditional" for loop for ~15-25% better performance (#5827)

Apparently there's less overhead this way.

See https://github.com/koreader/koreader/pull/5819 for context.
pull/5835/head
Frans de Jonge 4 years ago committed by GitHub
parent 1177baaf01
commit 6dfe65279c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -242,7 +242,8 @@ function FileChooser:genItemTableFromPath(path)
-- otherwise, show new files in bold
local show_file_in_bold = G_reader_settings:readSetting("show_file_in_bold")
for _, file in ipairs(files) do
for i = 1, #files do
local file = files[i]
local full_path = self.path.."/"..file.name
local file_size = lfs.attributes(full_path, "size") or 0
local sstr = getFriendlySize(file_size)

Loading…
Cancel
Save