[Lemon-commits] deba: r3317 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Fri Sep 28 14:14:19 CEST 2007


Author: deba
Date: Fri Sep 28 14:14:18 2007
New Revision: 3317

Modified:
   lemon/trunk/lemon/radix_sort.h

Log:
Bug fix in most significant digit calculation



Modified: lemon/trunk/lemon/radix_sort.h
==============================================================================
--- lemon/trunk/lemon/radix_sort.h	(original)
+++ lemon/trunk/lemon/radix_sort.h	Fri Sep 28 14:14:18 2007
@@ -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;
       }



More information about the Lemon-commits mailing list