~ubuntu-branches/debian/stretch/mudlet/stretch

« back to all changes in this revision

Viewing changes to src/mudlet-lua/lua/TableUtils.lua

  • Committer: Bazaar Package Importer
  • Author(s): Craig Small
  • Date: 2011-05-14 20:12:49 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110514201249-184gqx5jjqam02lg
Tags: 2.0-rc5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
362
362
        return t1
363
363
end
364
364
 
 
365
---Returns the index of the value in a table
 
366
function table.index_of(table, element)
 
367
  for index, value in ipairs(table) do
 
368
    if value == element then
 
369
      return index
 
370
    end
 
371
  end
 
372
  return nil
 
373
end
 
 
b'\\ No newline at end of file'