Software /
code /
prosody
Comparison
util/set.lua @ 5906:071a7e461ae7
util.set: Remove unused variable
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 10 Nov 2013 16:43:10 +0000 |
parent | 5813:c888f548876b |
child | 5908:081a91507e4f |
comparison
equal
deleted
inserted
replaced
5902:c11c0761a682 | 5906:071a7e461ae7 |
---|---|
21 end | 21 end |
22 function set_mt.__sub(set1, set2) | 22 function set_mt.__sub(set1, set2) |
23 return _M.difference(set1, set2); | 23 return _M.difference(set1, set2); |
24 end | 24 end |
25 function set_mt.__div(set, func) | 25 function set_mt.__div(set, func) |
26 local new_set, new_items = _M.new(); | 26 local new_set = _M.new(); |
27 local items, new_items = set._items, new_set._items; | 27 local items, new_items = set._items, new_set._items; |
28 for item in pairs(items) do | 28 for item in pairs(items) do |
29 local new_item = func(item); | 29 local new_item = func(item); |
30 if new_item ~= nil then | 30 if new_item ~= nil then |
31 new_items[new_item] = true; | 31 new_items[new_item] = true; |