mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed negative case in GetHighestBitSet
This commit is contained in:
parent
3454e26941
commit
cbe398b548
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue