]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/s-fixint.h
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / lib / sorter / s-fixint.h
index c8a2b9917659e0432c51aa6837665b25534bde99..20cce74b114998e12d4b5cdb6ddd13312e91e58b 100644 (file)
@@ -77,6 +77,8 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct
     , workspace, bin->hash_bits
 #endif
     );
+  if ((void *)buf != ctx->big_buf)
+    workspace = ctx->big_buf;
   ctx->total_int_time += get_timer(&timer);
 
   SORT_XTRACE(5, "s-fixint: Writing");
@@ -90,7 +92,7 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct
 #ifdef SORT_UNIFY
       if (i < n-1 && !P(compare)(&buf[i], &buf[i+1]))
        {
-         P(key) **keys = (ctx->big_buf == (void *)buf) ? (void *)workspace : ctx->big_buf;
+         P(key) **keys = workspace;
          uns n = 2;
          keys[0] = &buf[i];
          keys[1] = &buf[i+1];