]> mj.ucw.cz Git - libucw.git/commitdiff
Radix-sorting is not compatible with custom presort.
authorMartin Mares <mj@ucw.cz>
Sat, 10 Feb 2007 18:14:31 +0000 (19:14 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 10 Feb 2007 18:14:31 +0000 (19:14 +0100)
lib/sorter/govern.c

index 388fac4a4dff8c9a359d5e74f92c95bde46f5b62..c1ef332ca4d8c210cf2c598e4156b004ca31199a 100644 (file)
@@ -171,7 +171,9 @@ sorter_twoway(struct sort_context *ctx, struct sort_bucket *b)
 static uns
 sorter_radix_bits(struct sort_context *ctx, struct sort_bucket *b)
 {
-  if (!b->hash_bits || !ctx->radix_split || (sorter_debug & SORT_DEBUG_NO_RADIX))
+  if (!b->hash_bits || !ctx->radix_split ||
+      (b->flags & SBF_CUSTOM_PRESORT) ||
+      (sorter_debug & SORT_DEBUG_NO_RADIX))
     return 0;
 
   u64 in = sbuck_size(b);
@@ -187,7 +189,7 @@ sorter_radix_bits(struct sort_context *ctx, struct sort_bucket *b)
 }
 
 static void
-    sorter_radix(struct sort_context *ctx, struct sort_bucket *b, uns bits)
+sorter_radix(struct sort_context *ctx, struct sort_bucket *b, uns bits)
 {
   uns nbuck = 1 << bits;
   SORT_XTRACE(2, "Running radix sort on %s with %d bits of %d (expected size %s)",