mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user