Software /
code /
prosody
Diff
util/array.lua @ 13245:ffe4adbd2af9
util.array: Fix new() library function
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Jul 2023 16:31:05 +0200 |
parent | 13141:451cb119026e |
child | 13248:db433ed3135c |
line wrap: on
line diff
--- a/util/array.lua Sat Jul 22 16:20:36 2023 +0200 +++ b/util/array.lua Sat Jul 22 16:31:05 2023 +0200 @@ -36,7 +36,9 @@ return setmetatable(t or {}, array_mt); end -array.new = new_array; +function array.new(t) + return setmetatable(t or {}, array_mt); +end function array_mt.__add(a1, a2) local res = new_array();