diff options
author | sinanmohd <sinan@sinanmohd.com> | 2023-10-02 11:08:50 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2023-10-02 11:30:31 +0530 |
commit | 4607e62b5459ef04dd9f407c239adedc011760dd (patch) | |
tree | 2dca67a60bce2a0f30ab5ef5a67d9d8788ab3922 | |
parent | 83ab1b000a92286e4c033653f25c6ca270393bcc (diff) |
lib/uril/table_merge: dont modify arg table
-rw-r--r-- | lib/util.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/util.lua b/lib/util.lua index 8ea7699..fc61182 100644 --- a/lib/util.lua +++ b/lib/util.lua @@ -1,14 +1,18 @@ #!/usr/bin/env lua local table_merge = function (t1, t2) + local t = {} t1 = t1 or {} t2 = t2 or {} + for k, v in pairs(t1) do + t[k] = v + end for k, v in pairs(t2) do - t1[k] = v + t[k] = v end - return t1 + return t end local table_print = function (t) |