Bug fix in most significant digit calculation
authordeba
Fri, 28 Sep 2007 12:14:18 +0000
changeset 2477b5e1f017ff41
parent 2476 059dcdda37c5
child 2478 bf783151bc92
Bug fix in most significant digit calculation
lemon/radix_sort.h
     1.1 --- a/lemon/radix_sort.h	Thu Sep 27 13:04:06 2007 +0000
     1.2 +++ b/lemon/radix_sort.h	Fri Sep 28 12:14:18 2007 +0000
     1.3 @@ -139,7 +139,7 @@
     1.4  
     1.5      mask = 0; max_digit = 0;
     1.6      for (it = first; it != cut; ++it) {
     1.7 -      if ((mask | functor(*it)) != ~0) {
     1.8 +      while ((mask | functor(*it)) != ~0) {
     1.9  	++max_digit;
    1.10  	mask <<= 1; 
    1.11  	mask |= 1;
    1.12 @@ -149,7 +149,7 @@
    1.13  
    1.14      mask = ~0; max_digit = 0;
    1.15      for (it = cut; it != last; ++it) {
    1.16 -      if (mask & functor(*it)) {
    1.17 +      while (mask & functor(*it)) {
    1.18  	++max_digit;
    1.19  	mask <<= 1;
    1.20        }