optimisation: one less conditional branch in pulse2comb()
authorJean-Marc Valin <Jean-Marc.Valin@csiro.au>
Fri, 18 Apr 2008 06:58:19 +0000 (16:58 +1000)
committerJean-Marc Valin <Jean-Marc.Valin@csiro.au>
Fri, 18 Apr 2008 06:58:19 +0000 (16:58 +1000)
libcelt/cwrs.c

index fdd3c5e..9680233 100644 (file)
@@ -294,10 +294,11 @@ void pulse2comb(int _n,int _m,int *_x,int *_s,const int *_y){
       int s;
       n=abs(_y[j]);
       s=_y[j]<0;
-      for(;n-->0;k++){
+      do {
         _x[k]=j;
         _s[k]=s;
-      }
+        k++;
+      } while (--n>0);
     }
   }
 }