summaryrefslogtreecommitdiffstats
path: root/source/core/slang-uint-set.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-uint-set.cpp')
-rw-r--r--source/core/slang-uint-set.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/core/slang-uint-set.cpp b/source/core/slang-uint-set.cpp
index 3ac1c530a..02e142706 100644
--- a/source/core/slang-uint-set.cpp
+++ b/source/core/slang-uint-set.cpp
@@ -64,6 +64,21 @@ void UIntSet::clear()
::memset(m_buffer.getBuffer(), 0, m_buffer.getCount() * sizeof(Element));
}
+bool UIntSet::isEmpty() const
+{
+ const Element*const src = m_buffer.getBuffer();
+ const Index count = m_buffer.getCount();
+
+ for (Index i = 0; i < count; ++i)
+ {
+ if (src[i])
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
void UIntSet::clearAndDeallocate()
{
m_buffer.clearAndDeallocate();