# HG changeset patch # User deba # Date 1190981658 0 # Node ID b5e1f017ff418046b4cb8a5b4d66c4854e9ad5f3 # Parent 059dcdda37c5599b583c0d29200fea0ddf7e952a Bug fix in most significant digit calculation diff -r 059dcdda37c5 -r b5e1f017ff41 lemon/radix_sort.h --- a/lemon/radix_sort.h Thu Sep 27 13:04:06 2007 +0000 +++ b/lemon/radix_sort.h Fri Sep 28 12:14:18 2007 +0000 @@ -139,7 +139,7 @@ mask = 0; max_digit = 0; for (it = first; it != cut; ++it) { - if ((mask | functor(*it)) != ~0) { + while ((mask | functor(*it)) != ~0) { ++max_digit; mask <<= 1; mask |= 1; @@ -149,7 +149,7 @@ mask = ~0; max_digit = 0; for (it = cut; it != last; ++it) { - if (mask & functor(*it)) { + while (mask & functor(*it)) { ++max_digit; mask <<= 1; }