Fix hashlist:(ipairs|rpairs)

This commit is contained in:
Lars Mueller 2021-12-23 20:09:21 +01:00
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