Implemented solution suggested by @Kilobyte22 to make component.list() return a table instead of an iterator.

This commit is contained in:
Florian Nücke 2014-07-29 17:49:36 +02:00
parent bda75927a7
commit e361661c8b

View File

@ -487,12 +487,12 @@ libcomponent = {
checkArg(1, filter, "string", "nil")
local list = spcall(component.list, filter, not not exact)
local key = nil
return function()
return setmetatable(list, {__call=function()
key = next(list, key)
if key then
return key, list[key]
end
end
end})
end,
methods = function(address)
return spcall(component.methods, address)