Software /
code /
prosody
Comparison
util/set.lua @ 4684:dc70c4ffb66d
Merge timber->trunk - thanks everyone!
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 24 Apr 2012 21:59:20 +0100 |
parent | 4544:316e2b09a562 |
child | 4908:8c5b5ebaacb0 |
comparison
equal
deleted
inserted
replaced
4529:12621337471f | 4684:dc70c4ffb66d |
---|---|
80 function set:remove(item) | 80 function set:remove(item) |
81 items[item] = nil; | 81 items[item] = nil; |
82 end | 82 end |
83 | 83 |
84 function set:add_list(list) | 84 function set:add_list(list) |
85 for _, item in ipairs(list) do | 85 if list then |
86 items[item] = true; | 86 for _, item in ipairs(list) do |
87 items[item] = true; | |
88 end | |
87 end | 89 end |
88 end | 90 end |
89 | 91 |
90 function set:include(otherset) | 92 function set:include(otherset) |
91 for item in pairs(otherset) do | 93 for item in pairs(otherset) do |