Commit 68bf4fd8 authored by nanahira's avatar nanahira

fix iter in underscore

parent bc6dd55e
...@@ -37,10 +37,10 @@ end ...@@ -37,10 +37,10 @@ end
function Underscore.iter(list_or_iter) function Underscore.iter(list_or_iter)
if type(list_or_iter) == "function" then return list_or_iter end if type(list_or_iter) == "function" then return list_or_iter end
local pair_iter=ipairs(list_or_iter) local i = 0
return function() return function()
local placeholder,res=pair_iter() i = i + 1
return res return list_or_iter[i]
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment