History

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

"dir" is already used somewhere above. This was ok, but not nice.

wm4 committed 12 years ago

Commit dd91c091 parent 3a7ecf61 file · +4 −4Browse files

Unified · Split

TOOLS/lua/autoload.lua+4−4
@@ -40,10 +40,10 @@ function find_and_add_entries() · 39 unmodified lines
4040 return
4141 end
4242 local append = {[-1] = {}, [1] = {}}
43− for dir = -1, 1, 2 do -- 2 iterations, with dir = -1 and +1
43+ for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1
4444 for i = 1, MAXENTRIES do
45− local file = files[current + i * dir]
46− local pl_e = pl[pl_current + i * dir]
45+ local file = files[current + i * direction]
46+ local pl_e = pl[pl_current + i * direction]
4747 if file == nil or file[1] == "." then
4848 break
4949 end
@@ -53,7 +53,7 @@ function find_and_add_entries() · 3 unmodified lines
5353 break
5454 end
5555 end
56− if dir == -1 then
56+ if direction == -1 then
5757 if pl_current == 1 then -- never add additional entries in the middle
5858 mp.msg.info("Prepending " .. file)
5959 table.insert(append[-1], 1, file)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t