diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-06-20 22:45:07 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-06-20 22:45:07 +0100 |
commit | 38f157315aabc79dcb79d2bd836448ed9256c961 (patch) | |
tree | 6829137a7dc423800a93ea9aa1c5c071b583b185 /util/array.lua | |
parent | 72331edf3e00823a5d5f82f0f370de1d40a2555f (diff) | |
download | prosody-38f157315aabc79dcb79d2bd836448ed9256c961.tar.gz prosody-38f157315aabc79dcb79d2bd836448ed9256c961.zip |
util.array: Make array:reverse() and array:shuffle() return the array to allow chaining
Diffstat (limited to 'util/array.lua')
-rw-r--r-- | util/array.lua | 2 |
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) |