mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
Add table.from_iterator
This commit is contained in:
parent
e6a71ac13f
commit
e84f090d03
@ -10,6 +10,14 @@ empty = {}
|
||||
|
||||
-- Table helpers
|
||||
|
||||
function from_iterator(...)
|
||||
local table = {}
|
||||
for key, value in ... do
|
||||
table[key] = value
|
||||
end
|
||||
return table
|
||||
end
|
||||
|
||||
function map_index(table, func)
|
||||
local mapping_metatable = {
|
||||
__index = function(table, key)
|
||||
|
Loading…
Reference in New Issue
Block a user