|
On 5/7/14, 2:19 PM, Paul K wrote:
It's actually shorter to keep the constant string but not assign type to a local, since it's only called once - at 238:I managed to get 242 bytes/chars... I could probably do less tho... local k,o,d=next,type d=function(a,r,t)if"table"~=o(a)then return a end t={}r=rreplace "table" with o{} to save few more bytes... Paul.
local k,d=next d=function(a,r,t)if"table"~=type(a)then return a end t={}r=r or{}r[a]=t for x,y in k,a do a[r[x]or d(x,r)]=r[y]or d(y,r)end return t end table.copy={shallow=function(a,b)b={}for x,y in k,a do b[x]=y end return b end,deep=d}