Core/Bitset: Fix infinite loop
Former-commit-id: f1246eedcd7a0b327e7e4a70803eb5cd20b071ef
This commit is contained in:
parent
e9608366cd
commit
8740cf393c
|
|
@ -126,13 +126,10 @@ namespace Nz
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Note: I was kinda tired when I wrote this, there's probably a much easier method than checking bits to write bits
|
// Note: I was kinda tired when I wrote this, there's probably a much easier method than checking bits to write bits
|
||||||
unsigned int bitPos = 0;
|
for (unsigned int bitPos = 0; bitPos < std::numeric_limits<T>::digits; bitPos++)
|
||||||
for (T bit = 1; bit < std::numeric_limits<T>::max(); bit <<= 1)
|
|
||||||
{
|
{
|
||||||
if (value & bit)
|
if (value & (T(1U) << bitPos))
|
||||||
UnboundedSet(bitPos, true);
|
UnboundedSet(bitPos, true);
|
||||||
|
|
||||||
bitPos++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue