doc: improve gears.table.iterate

This commit is contained in:
Daniel Hahler 2018-02-07 21:49:16 +01:00
parent 31b8623ff6
commit c5f2aa8e83
1 changed files with 7 additions and 4 deletions

View File

@ -179,10 +179,13 @@ end
--
-- @class function
-- @name iterate
-- @param t the table to iterate
-- @param filter a function that returns true to indicate a positive match
-- @param start what index to start iterating from. Default is 1 (=> start of
-- the table)
-- @tparam table t The table to iterate.
-- @tparam func filter A function that returns true to indicate a positive
-- match.
-- @param func.item The item to filter.
-- @tparam[opt=1] int start Index to start iterating from.
-- Default is 1 (=> start of the table).
-- @treturn func
function gtable.iterate(t, filter, start)
local count = 0
local index = start or 1