# HG changeset patch # User Matthew Wild # Date 1631440287 -3600 # Node ID 1ceee8becb1a25c280547b29e3ce14165c90fe1f # Parent 3ae6fa901a8bd41b240d1459c24ce7e7b41a251a util.set: Add :contains_set() method diff -r 3ae6fa901a8b -r 1ceee8becb1a util/set.lua --- 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