Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Efficiency and code size improvement. The first term in most of the if statements was redundant anyway due to the preceding if but the daisy chain of if can be dispensed with completely. Tested out of context with #include <stdio.h> void calculate(int samples) { int divBit; printf("%d ", samples); samples >>= 1; for(divBit = 0; samples != 0; samples >>= 1, divBit++); printf("%d %d\n", 1 << divBit, divBit); } int main() { calculate(3); calculate(7); calculate(8); }
- Loading branch information