Mercurial > prosody-hg
comparison util/set.lua @ 13123:dee26e4cfb2b
util.set: Remove duplicate __freeze metamethod
Backs out 895a82c5d8d4 beacuse __freeze already added in a96a2fbcc6c0
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 01 Jun 2023 14:33:57 +0200 |
| parents | a863e4237b91 |
| children |
comparison
equal
deleted
inserted
replaced
| 13122:45458ecaacae | 13123:dee26e4cfb2b |
|---|---|
| 187 s[#s+1] = tostring(item); | 187 s[#s+1] = tostring(item); |
| 188 end | 188 end |
| 189 return "{"..t_concat(s, ", ").."}"; | 189 return "{"..t_concat(s, ", ").."}"; |
| 190 end | 190 end |
| 191 | 191 |
| 192 function set_mt.__freeze(set) | |
| 193 local s = {}; | |
| 194 for item in pairs(set._items) do | |
| 195 s[#s + 1] = item; | |
| 196 end | |
| 197 return s; | |
| 198 end | |
| 199 | |
| 200 | |
| 201 return { | 192 return { |
| 202 new = new; | 193 new = new; |
| 203 is_set = is_set; | 194 is_set = is_set; |
| 204 union = union; | 195 union = union; |
| 205 difference = difference; | 196 difference = difference; |
