mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
Fix hashlist:(ipairs|rpairs)
This commit is contained in:
parent
83c5c87390
commit
fbbcc27fed
@ -32,8 +32,9 @@ function list:len()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function list:ipairs()
|
function list:ipairs()
|
||||||
local index = 1
|
local index = 0
|
||||||
return function()
|
return function()
|
||||||
|
index = index + 1
|
||||||
if index > self.length then
|
if index > self.length then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -42,8 +43,9 @@ function list:ipairs()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function list:rpairs()
|
function list:rpairs()
|
||||||
local index = self.length
|
local index = self.length + 1
|
||||||
return function()
|
return function()
|
||||||
|
index = index - 1
|
||||||
if index < 1 then
|
if index < 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user