Change parameter order for filter and map
This commit is contained in:
parent
42f3f96a19
commit
5c41c4d1d5
@ -70,7 +70,7 @@ function unstring(input)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function map(table, func)
|
function map(func, table)
|
||||||
local t={}
|
local t={}
|
||||||
for k, v in pairs(table) do
|
for k, v in pairs(table) do
|
||||||
t[k]=func(v)
|
t[k]=func(v)
|
||||||
@ -78,7 +78,7 @@ function map(table, func)
|
|||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
function filter(table, func)
|
function filter(func, table)
|
||||||
local t={}
|
local t={}
|
||||||
for k, v in pairs(table) do
|
for k, v in pairs(table) do
|
||||||
if func(v) then
|
if func(v) then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user