mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
Implemented solution suggested by @Kilobyte22 to make component.list() return a table instead of an iterator.
This commit is contained in:
parent
bda75927a7
commit
e361661c8b
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user