1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-23 20:00:56 +00:00

TOOLS/lua/autoload: don't shadow local variable

"dir" is already used somewhere above. This was ok, but not nice.
This commit is contained in:
wm4 2014-10-26 14:34:37 +01:00
parent 3a7ecf65e2
commit dd91c09a71

View File

@ -40,10 +40,10 @@ function find_and_add_entries()
return
end
local append = {[-1] = {}, [1] = {}}
for dir = -1, 1, 2 do -- 2 iterations, with dir = -1 and +1
for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1
for i = 1, MAXENTRIES do
local file = files[current + i * dir]
local pl_e = pl[pl_current + i * dir]
local file = files[current + i * direction]
local pl_e = pl[pl_current + i * direction]
if file == nil or file[1] == "." then
break
end
@ -53,7 +53,7 @@ function find_and_add_entries()
break
end
end
if dir == -1 then
if direction == -1 then
if pl_current == 1 then -- never add additional entries in the middle
mp.msg.info("Prepending " .. file)
table.insert(append[-1], 1, file)