mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 02:52:21 +00:00
Removed support of nil
in lume.ripairs(), updated tests
This commit is contained in:
3
lume.lua
3
lume.lua
@@ -682,9 +682,6 @@ local ripairs_iter = function(t, i)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function lume.ripairs(t)
|
function lume.ripairs(t)
|
||||||
if t == nil then
|
|
||||||
return noop
|
|
||||||
end
|
|
||||||
return ripairs_iter, t, (#t + 1)
|
return ripairs_iter, t, (#t + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -562,8 +562,7 @@ tests["lume.ripairs"] = function()
|
|||||||
table.insert(r, { i, v })
|
table.insert(r, { i, v })
|
||||||
end
|
end
|
||||||
testeq( r, { { 3, "c" }, { 2, "b" }, { 1, "a" } })
|
testeq( r, { { 3, "c" }, { 2, "b" }, { 1, "a" } })
|
||||||
for i, v in lume.ripairs(nil) do
|
tester.test.error(lume.ripairs, nil)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lume.rgba
|
-- lume.rgba
|
||||||
|
Reference in New Issue
Block a user