Skip to content

Instantly share code, notes, and snippets.

View SoniEx2's full-sized avatar

Soni L. SoniEx2

View GitHub Profile
@SoniEx2
SoniEx2 / special.lua
Last active August 29, 2015 14:01
IRC friendly Lua table copy
-- the following deep copy function never stack overflows from recursion
-- needs optimization tho
local function deep(inp,copies)
-- push
local stack = {{inp = inp, key = nil, value = nil, next = false, skipNext = false, out = nil}}
local currentResult
copies = (type(copies) == "table") and copies or {}