summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-uint-set.cpp6
-rw-r--r--source/core/slang-uint-set.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/source/core/slang-uint-set.cpp b/source/core/slang-uint-set.cpp
index b6871c192..ba71254e1 100644
--- a/source/core/slang-uint-set.cpp
+++ b/source/core/slang-uint-set.cpp
@@ -106,7 +106,7 @@ void UIntSet::subtractWith(const UIntSet& set)
/* static */void UIntSet::calcUnion(UIntSet& outRs, const UIntSet& set1, const UIntSet& set2)
{
- outRs.m_buffer.setCount(Math::Max(set1.m_buffer.getCount(), set2.m_buffer.getCount()));
+ outRs.resizeBackingBufferDirectly(Math::Max(set1.m_buffer.getCount(), set2.m_buffer.getCount()));
outRs.clear();
for (Index i = 0; i < set1.m_buffer.getCount(); i++)
outRs.m_buffer[i] |= set1.m_buffer[i];
@@ -117,7 +117,7 @@ void UIntSet::subtractWith(const UIntSet& set)
/* static */void UIntSet::calcIntersection(UIntSet& outRs, const UIntSet& set1, const UIntSet& set2)
{
const Index minCount = Math::Min(set1.m_buffer.getCount(), set2.m_buffer.getCount());
- outRs.m_buffer.setCount(minCount);
+ outRs.resizeBackingBufferDirectly(minCount);
for (Index i = 0; i < minCount; i++)
outRs.m_buffer[i] = set1.m_buffer[i] & set2.m_buffer[i];
@@ -125,7 +125,7 @@ void UIntSet::subtractWith(const UIntSet& set)
/* static */void UIntSet::calcSubtract(UIntSet& outRs, const UIntSet& set1, const UIntSet& set2)
{
- outRs.m_buffer.setCount(set1.m_buffer.getCount());
+ outRs.resizeBackingBufferDirectly(set1.m_buffer.getCount());
const Index minCount = Math::Min(set1.m_buffer.getCount(), set2.m_buffer.getCount());
for (Index i = 0; i < minCount; i++)
diff --git a/source/core/slang-uint-set.h b/source/core/slang-uint-set.h
index 077bc7981..4ba067871 100644
--- a/source/core/slang-uint-set.h
+++ b/source/core/slang-uint-set.h
@@ -32,10 +32,10 @@ static inline Index bitscanForward(uint64_t in)
#else
uint32_t out;
// check for 0s in 0bit->31bit. If all 0's, check for 0s in 32bit->63bit
- if (_BitScanForward((unsigned long*)&out, *(((uint32_t*)&in) + 1)))
+ if (_BitScanForward((unsigned long*)&out, *(((uint32_t*)&in))))
return Index(out);
- _BitScanForward((unsigned long*)&out, *(((uint32_t*)&in)));
- return Index(out);
+ _BitScanForward((unsigned long*)&out, *(((uint32_t*)&in)+1));
+ return Index(out)+32;
#endif// #ifdef _WIN64
#else