X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fscratch-writer.c;h=42e77aa7b47869f5483c542f68142e4892cf541a;hb=72147c12357446b304264b6944b8a1d92c45f53c;hp=8bedef65677d984c67a2391cc9c47fa598d779ba;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp-builds.git diff --git a/src/data/scratch-writer.c b/src/data/scratch-writer.c index 8bedef65..42e77aa7 100644 --- a/src/data/scratch-writer.c +++ b/src/data/scratch-writer.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 2006 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -22,6 +21,7 @@ #include #include "case.h" #include "casefile.h" +#include "fastfile.h" #include "dictionary.h" #include "file-handle-def.h" #include "scratch-handle.h" @@ -61,7 +61,7 @@ scratch_writer_open (struct file_handle *fh, /* Copy the dictionary and compact if needed. */ scratch_dict = dict_clone (dictionary); - if (dict_needs_compaction (scratch_dict)) + if (dict_compacting_would_shrink (scratch_dict)) { compactor = dict_make_compactor (scratch_dict); dict_compact_values (scratch_dict); @@ -72,7 +72,7 @@ scratch_writer_open (struct file_handle *fh, /* Create new contents. */ sh = xmalloc (sizeof *sh); sh->dictionary = scratch_dict; - sh->casefile = casefile_create (dict_get_next_value_idx (sh->dictionary)); + sh->casefile = fastfile_create (dict_get_next_value_idx (sh->dictionary)); /* Create writer. */ writer = xmalloc (sizeof *writer); @@ -115,7 +115,6 @@ scratch_writer_close (struct scratch_writer *writer) { struct casefile *cf = writer->handle->casefile; bool ok = casefile_error (cf); - casefile_mode_reader (cf); fh_close (writer->fh, "scratch file", "we"); free (writer); return ok;