mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 22:24:35 +00:00
parent
a2c7800290
commit
1de942daa8
@ -256,8 +256,12 @@ function tablex.dedupe(t)
|
|||||||
return r
|
return r
|
||||||
end
|
end
|
||||||
|
|
||||||
--(might already exist depending on luajit)
|
--(might already exist depending on environment)
|
||||||
if not tablex.clear then
|
if not tablex.clear then
|
||||||
|
local imported
|
||||||
|
--pull in from luajit if possible
|
||||||
|
imported, tablex.clear = pcall(require, "table.clear")
|
||||||
|
if not imported then
|
||||||
--remove all values from a table
|
--remove all values from a table
|
||||||
--useful when multiple references are being held
|
--useful when multiple references are being held
|
||||||
--so you cannot just create a new table
|
--so you cannot just create a new table
|
||||||
@ -270,6 +274,7 @@ if not tablex.clear then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--note:
|
--note:
|
||||||
-- copies and overlays are currently not satisfactory
|
-- copies and overlays are currently not satisfactory
|
||||||
|
Loading…
Reference in New Issue
Block a user