Don't search if there are no files
This commit is contained in:
parent
00d555b016
commit
5dca37b11a
|
@ -191,6 +191,7 @@ end
|
||||||
local function file_search(files, info)
|
local function file_search(files, info)
|
||||||
local filename, type = info.filename, info.type
|
local filename, type = info.filename, info.type
|
||||||
local inf, sup = 1, #files
|
local inf, sup = 1, #files
|
||||||
|
if sup <= 0 then return 1, false end
|
||||||
while sup - inf > 8 do
|
while sup - inf > 8 do
|
||||||
local curr = math.floor((inf + sup) / 2)
|
local curr = math.floor((inf + sup) / 2)
|
||||||
if system.path_compare(filename, type, files[curr].filename, files[curr].type) then
|
if system.path_compare(filename, type, files[curr].filename, files[curr].type) then
|
||||||
|
|
Loading…
Reference in New Issue