summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/clua
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2009-12-25 16:18:47 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2009-12-25 16:20:15 +0530
commitcff43655c657b8ce52e2710cff321b49f05eeea5 (patch)
tree9056f21e2b0b3d6538e9c47b1ea23783205a4080 /crawl-ref/source/dat/clua
parent214c798064a28a48126a6faf487303fab25b2dd7 (diff)
downloadcrawl-ref-cff43655c657b8ce52e2710cff321b49f05eeea5.tar.gz
crawl-ref-cff43655c657b8ce52e2710cff321b49f05eeea5.zip
Fix util.append (due).
Diffstat (limited to 'crawl-ref/source/dat/clua')
-rw-r--r--crawl-ref/source/dat/clua/util.lua16
1 files changed, 5 insertions, 11 deletions
diff --git a/crawl-ref/source/dat/clua/util.lua b/crawl-ref/source/dat/clua/util.lua
index 5ef063d9fb..d6e842fa7e 100644
--- a/crawl-ref/source/dat/clua/util.lua
+++ b/crawl-ref/source/dat/clua/util.lua
@@ -86,18 +86,12 @@ function util.set(list)
end
-- Appends the elements in any number of additional tables to the first table.
-function util.append(table, ...)
- local res = table
+function util.append(first, ...)
+ local res = first
local tables = { ... }
- if #tables == 0 then
- return res
- elseif #tables == 1 and #res == 0 then
- return tables[1]
- else
- for _, tab in ipairs(tables) do
- for _, val in ipairs(tab) do
- table.insert(res, val)
- end
+ for _, tab in ipairs(tables) do
+ for _, val in ipairs(tab) do
+ table.insert(res, val)
end
end
return res