# HG changeset patch # User rbultje # Date 1257804243 0 # Node ID 8d536f190e6e674a3d08a40d4b49add736d5498c # Parent f132cde57bbedf751a03d068be5dcf7cbefb711e And on the sixth day, God gave us the <= operand, which makes the loop "for (i = 1; i < num + 1; i++)" look like "for (i = 1; i <= num; i++)". Programmers worldwide rejoiced and used the operand, e.g. in the thread "[PATCH] remove ugliness in cel_filters.c", and He saw that it was good. diff -r f132cde57bbe -r 8d536f190e6e celp_filters.c --- a/celp_filters.c Mon Nov 09 12:06:19 2009 +0000 +++ b/celp_filters.c Mon Nov 09 22:04:03 2009 +0000 @@ -67,12 +67,9 @@ { int i,n; - // Avoids a +1 in the inner loop. - filter_length++; - for (n = 0; n < buffer_length; n++) { int sum = rounder; - for (i = 1; i < filter_length; i++) + for (i = 1; i <= filter_length; i++) sum -= filter_coeffs[i-1] * out[n-i]; sum = (sum >> 12) + in[n]; @@ -96,12 +93,9 @@ { int i,n; - // Avoids a +1 in the inner loop. - filter_length++; - for (n = 0; n < buffer_length; n++) { out[n] = in[n]; - for (i = 1; i < filter_length; i++) + for (i = 1; i <= filter_length; i++) out[n] -= filter_coeffs[i-1] * out[n-i]; } } @@ -114,12 +108,9 @@ { int i,n; - // Avoids a +1 in the inner loop. - filter_length++; - for (n = 0; n < buffer_length; n++) { out[n] = in[n]; - for (i = 1; i < filter_length; i++) + for (i = 1; i <= filter_length; i++) out[n] += filter_coeffs[i-1] * in[n-i]; } }