Fixed GetNearestPowerOfTwo function

Returning the next POT even if the number was a POT itself


Former-commit-id: 812f35d13a99985ca5c12517cd84de22292e52c7
This commit is contained in:
Lynix 2015-01-24 14:34:36 +01:00
parent d1f1906f37
commit 0e48f052e5
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ inline unsigned int NzGetNearestPowerOfTwo(unsigned int number)
///TODO: Marquer comme constexpr en C++14
unsigned int x = 1;
// Tant que x est plus petit que n, on décale ses bits vers la gauche, ce qui revient à multiplier par deux
while (x <= number)
while (x < number)
x <<= 1;
return x;