silly log2 rounded the wrong way

This commit is contained in:
espes 2014-05-26 23:05:56 +10:00
parent 88de3488d9
commit dad84440f9
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@
static unsigned int log2(unsigned int i)
{
unsigned int r = 0;
while (i >> ++r);
while (i >>= 1) r++;
return r;
}