mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 05:37:39 +03:00
util.set: Change '/' operator from filter to map+filter (nil to drop from set, false is a valid item). No code found which depends on current behaviour.
This commit is contained in:
parent
81a34bee5e
commit
ea48b240ef
1 changed files with 3 additions and 2 deletions
|
@ -26,8 +26,9 @@ function set_mt.__div(set, func)
|
|||
local new_set, new_items = _M.new();
|
||||
local items, new_items = set._items, new_set._items;
|
||||
for item in pairs(items) do
|
||||
if func(item) then
|
||||
new_items[item] = true;
|
||||
local new_item = func(item);
|
||||
if new_item ~= nil then
|
||||
new_items[new_item] = true;
|
||||
end
|
||||
end
|
||||
return new_set;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue