]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/govern.c
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / lib / sorter / govern.c
index 7231a5b77a56ef48a93ecdd59038993e83c37f90..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);
@@ -436,4 +436,5 @@ sorter_run(struct sort_context *ctx)
   SORT_XTRACE(2, "Final timings: %.3fs external sorting, %.3fs presorting, %.3fs internal sorting",
              ctx->total_ext_time/1000., ctx->total_pre_time/1000., ctx->total_int_time/1000.);
   ctx->out_fb = sbuck_read(bout);
+  mp_delete(ctx->pool);
 }