fix infinite recursion in FindFirstBit64

This commit is contained in:
Yourself
2021-11-07 18:22:40 -07:00
parent 10c46946ae
commit 3a1e427b0c

View File

@@ -45,8 +45,8 @@ uint8 FindFirstBit32(uint32 x)
uint8 FindFirstBit64(uint64 x) uint8 FindFirstBit64(uint64 x)
{ {
if (x == 0) return 0; if (x == 0) return 0;
if ((x & 0x00000000ffffffffULL) != 0) return FindFirstBit(x); if ((x & 0x00000000ffffffffULL) != 0) return FindFirstBit(static_cast<uint32>(x));
return FindFirstBit(x >> 32) + 32; return FindFirstBit(static_cast<uint32>(x >> 32)) + 32;
} }
#endif #endif