Software /
code /
prosody
Diff
util/set.lua @ 11788:1ceee8becb1a
util.set: Add :contains_set() method
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 12 Sep 2021 10:51:27 +0100 |
parent | 11560:3bbb1af92514 |
child | 12986:895a82c5d8d4 |
line wrap: on
line diff
--- a/util/set.lua Sun Sep 12 10:50:20 2021 +0100 +++ b/util/set.lua Sun Sep 12 10:51:27 2021 +0100 @@ -52,6 +52,15 @@ return items[item]; end + function set:contains_set(other_set) + for item in other_set do + if not self:contains(item) then + return false; + end + end + return true; + end + function set:items() return next, items; end