Commit 6391fe82 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Jean-Marc Valin
Browse files

Minor optimisation -- using do-while() instead of for() in isqrt32()

parent 7aa0ed40
......@@ -155,7 +155,7 @@ static unsigned isqrt32(celt_uint32_t _val){
g=0;
bshift=EC_ILOG(_val)-1>>1;
b=1U<<bshift;
for(;bshift>=0;bshift--){
do{
celt_uint32_t t;
t=((celt_uint32_t)g<<1)+b<<bshift;
if(t<=_val){
......@@ -163,7 +163,9 @@ static unsigned isqrt32(celt_uint32_t _val){
_val-=t;
}
b>>=1;
bshift--;
}
while(bshift>=0);
return g;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment