aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-06-20 22:45:07 +0100
committerMatthew Wild <mwild1@gmail.com>2009-06-20 22:45:07 +0100
commit38f157315aabc79dcb79d2bd836448ed9256c961 (patch)
tree6829137a7dc423800a93ea9aa1c5c071b583b185 /util
parent72331edf3e00823a5d5f82f0f370de1d40a2555f (diff)
downloadprosody-38f157315aabc79dcb79d2bd836448ed9256c961.tar.gz
prosody-38f157315aabc79dcb79d2bd836448ed9256c961.zip
util.array: Make array:reverse() and array:shuffle() return the array to allow chaining
Diffstat (limited to 'util')
-rw-r--r--util/array.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/array.lua b/util/array.lua
index 11ff651c..8b9102bf 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -42,6 +42,7 @@ function array:shuffle()
local r = math.random(i,len);
self[i], self[r] = self[r], self[i];
end
+ return self;
end
function array:reverse()
@@ -50,6 +51,7 @@ function array:reverse()
self:push(self[i]);
self:pop(i);
end
+ return self;
end
function array:append(array)