]> mj.ucw.cz Git - libucw.git/commitdiff
Do not die on ASSERT when sorting an empty input with custom presorter.
authorMartin Mares <mj@ucw.cz>
Fri, 21 Sep 2007 09:14:55 +0000 (11:14 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 21 Sep 2007 09:14:55 +0000 (11:14 +0200)
We have test that not only the join bucket is available, but that the join
has actually happened, because custom presorters do not implement automatic
joining.

lib/sorter/govern.c

index 43b1668846fb975c1fb06fdfe415bb38df328586..2d7f4e952626618d3defdf4d67d7133725f2824d 100644 (file)
@@ -77,7 +77,7 @@ sbuck_join_to(struct sort_bucket *b, sh_off_t *sizep)
 static sh_off_t
 sbuck_ins_or_join(struct sort_bucket *b, cnode *list_pos, struct sort_bucket *join, sh_off_t join_size)
 {
-  if (join)
+  if (join && join->runs >= 2)
     {
       if (b)
        sbuck_drop(b);