Merge pull request #2182 from blueyed/doc-gtable-iterate

doc: improve gears.table.iterate
This commit is contained in:
mergify[bot] 2018-11-12 16:40:53 +00:00 committed by GitHub
commit bf50daf94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -180,10 +180,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