1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed negative case in GetHighestBitSet

This commit is contained in:
Brian Fiete 2022-02-24 11:16:45 -08:00
parent 3454e26941
commit cbe398b548

View file

@ -1009,7 +1009,7 @@ int32 Beefy::Rand()
int32 Beefy::GetHighestBitSet(int32 n) int32 Beefy::GetHighestBitSet(int32 n)
{ {
int i = 0; int i = 0;
for (; n; n >>= 1, i++) for (; n; n = (int)((uint32)n >> 1), i++)
; /* empty */ ; /* empty */
return i; return i;
} }