forked from bartvdbraak/blender
micro-optimization, avoid checking is_power_of_2_i once in power_of_2_max_i
also whitespace edit.
This commit is contained in:
parent
1ac57ccbc8
commit
260d6cd6b5
@ -131,8 +131,9 @@ MINLINE int power_of_2_max_i(int n)
|
|||||||
if (is_power_of_2_i(n))
|
if (is_power_of_2_i(n))
|
||||||
return n;
|
return n;
|
||||||
|
|
||||||
while (!is_power_of_2_i(n))
|
do {
|
||||||
n = n & (n - 1);
|
n = n & (n - 1);
|
||||||
|
} while (!is_power_of_2_i(n));
|
||||||
|
|
||||||
return n * 2;
|
return n * 2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user