diff options
author | Kim Alvefur <zash@zash.se> | 2016-10-18 19:07:55 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-10-18 19:07:55 +0200 |
commit | 0b21ca653d69a7b53f75c576b5902d8684c32e61 (patch) | |
tree | a7bd7a664b80ac2d321bef9ef2e7a465e32982a5 /util/array.lua | |
parent | 98be2f263bd887a0f0f53a405f9d8f42d270a176 (diff) | |
parent | de5e008d57702c1aeb196a718c045b0517ba631f (diff) | |
download | prosody-0b21ca653d69a7b53f75c576b5902d8684c32e61.tar.gz prosody-0b21ca653d69a7b53f75c576b5902d8684c32e61.zip |
Merge 0.10->trunk
Diffstat (limited to 'util/array.lua')
-rw-r--r-- | util/array.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/array.lua b/util/array.lua index 3ddc97f6..ea520f6b 100644 --- a/util/array.lua +++ b/util/array.lua @@ -19,7 +19,7 @@ local type = type; local array = {}; local array_base = {}; local array_methods = {}; -local array_mt = { __index = array_methods, __tostring = function (array) return "{"..array:concat(", ").."}"; end }; +local array_mt = { __index = array_methods, __tostring = function (self) return "{"..self:concat(", ").."}"; end }; local function new_array(self, t, _s, _var) if type(t) == "function" then -- Assume iterator @@ -106,7 +106,7 @@ function array_base.reverse(outa, ina) end --- These methods only mutate the array -function array_methods:shuffle(outa, ina) +function array_methods:shuffle() local len = #self; for i = 1, #self do local r = math_random(i, len); @@ -115,10 +115,10 @@ function array_methods:shuffle(outa, ina) return self; end -function array_methods:append(array) - local len, len2 = #self, #array; +function array_methods:append(ina) + local len, len2 = #self, #ina; for i = 1, len2 do - self[len+i] = array[i]; + self[len+i] = ina[i]; end return self; end |