summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-uint-set.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/core/slang-uint-set.h b/source/core/slang-uint-set.h
index f2c573865..4912ae504 100644
--- a/source/core/slang-uint-set.h
+++ b/source/core/slang-uint-set.h
@@ -52,6 +52,8 @@ public:
/// Returns true if the value is present
inline bool contains(UInt val) const;
+ inline bool contains(const UIntSet& set) const;
+
/// ==
bool operator==(const UIntSet& set) const;
/// !=
@@ -111,6 +113,25 @@ inline bool UIntSet::contains(UInt val) const
}
// --------------------------------------------------------------------------
+inline bool UIntSet::contains(const UIntSet& set) const
+{
+ for (Index i = 0; i < set.m_buffer.getCount(); i++)
+ {
+ if (i >= m_buffer.getCount())
+ {
+ if (set.m_buffer[i])
+ return false;
+ }
+ else
+ {
+ if ((m_buffer[i] & set.m_buffer[i]) != set.m_buffer[i])
+ return false;
+ }
+ }
+ return true;
+}
+
+// --------------------------------------------------------------------------
inline void UIntSet::add(UInt val)
{
const Index idx = Index(val >> kElementShift);