Don't search if there are no files

This commit is contained in:
Guldoman 2021-11-24 05:03:42 +01:00 committed by Francesco Abbate
parent 43a6e21135
commit 23f83857c5
1 changed files with 1 additions and 0 deletions

View File

@ -191,6 +191,7 @@ end
local function file_search(files, info)
local filename, type = info.filename, info.type
local inf, sup = 1, #files
if sup <= 0 then return 1, false end
while sup - inf > 8 do
local curr = math.floor((inf + sup) / 2)
if system.path_compare(filename, type, files[curr].filename, files[curr].type) then