Comparison

util/array.lua @ 13141:451cb119026e

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 10 Jun 2023 13:06:05 +0200
parent 13032:ea4923bebca9
parent 13138:0b0cefce6e42
child 13245:ffe4adbd2af9
comparison
equal deleted inserted replaced
13140:7a6874f9fd40 13141:451cb119026e
33 if type(t) == "function" then -- Assume iterator 33 if type(t) == "function" then -- Assume iterator
34 t = self.collect(t, _s, _var); 34 t = self.collect(t, _s, _var);
35 end 35 end
36 return setmetatable(t or {}, array_mt); 36 return setmetatable(t or {}, array_mt);
37 end 37 end
38
39 array.new = new_array;
38 40
39 function array_mt.__add(a1, a2) 41 function array_mt.__add(a1, a2)
40 local res = new_array(); 42 local res = new_array();
41 return res:append(a1):append(a2); 43 return res:append(a1):append(a2);
42 end 44 end