2,875
edits
No edit summary |
No edit summary |
||
Line 62: | Line 62: | ||
local self = setmetatable(Enumerator.new(), TableEnumerator) | local self = setmetatable(Enumerator.new(), TableEnumerator) | ||
self.tbl = tbl | self.tbl = tbl | ||
return self | return self | ||
end | end | ||
function TableEnumerator:moveNext() | function TableEnumerator:moveNext() | ||
if self.state == 0 then | if self.state == 0 then | ||
self.state = 1 | self.state = 1 | ||
Line 88: | Line 85: | ||
function TableEnumerator:getEnumerator() | function TableEnumerator:getEnumerator() | ||
if self.state == 0 then | if self.state == 0 then | ||
return self | return self | ||
else | else | ||
return TableEnumerator.new(self.tbl) | return TableEnumerator.new(self.tbl) | ||
end | end |
edits