Added lume.clear() and tests

This commit is contained in:
rxi
2015-02-07 22:51:28 +00:00
parent 14b9ee0ca2
commit fa85f83d70
2 changed files with 18 additions and 0 deletions

View File

@@ -175,6 +175,14 @@ function lume.remove(t, x)
end
function lume.clear(t)
local iter = getiter(t)
for k, v in iter(t) do
t[k] = nil
end
end
function lume.shuffle(t)
local rtn = {}
for i = 1, #t do