X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsys-file-writer.c;h=11ca1ef9fe032f398054dd3348ec96c6bb333f13;hb=c489ad9041918ca8c80dadceade988daab1d25f8;hp=fe2c27c8102c71f23852d9d9ada4abd44b78f2b4;hpb=f4a8d7e70526f52b3148f386344158f4b6f343ca;p=pspp-builds.git diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index fe2c27c8..11ca1ef9 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -103,7 +103,6 @@ static void write_variable_display_parameters (struct sfm_writer *w, const struct dictionary *dict); static void write_documents (struct sfm_writer *, const struct dictionary *); -static int does_dict_need_translation (const struct dictionary *); static inline int var_flt64_cnt (const struct variable *v) @@ -194,7 +193,7 @@ sfm_open_writer (struct file_handle *fh, struct dictionary *d, w->fh = fh; w->file = fdopen (fd, "w"); - w->needs_translation = does_dict_need_translation (d); + w->needs_translation = dict_compacting_would_change (d); w->compress = opts.compress; w->case_cnt = 0; w->flt64_cnt = 0; @@ -328,27 +327,6 @@ sfm_open_writer (struct file_handle *fh, struct dictionary *d, goto error; } -/* Returns zero if dictionary D's cases are ordered in the - natural manner, with the first variable followed by the - second, and so on, - nonzero otherwise. */ -static int -does_dict_need_translation (const struct dictionary *d) -{ - size_t case_idx; - size_t i; - - case_idx = 0; - for (i = 0; i < dict_get_var_cnt (d); i++) - { - struct variable *v = dict_get_var (d, i); - if (v->fv != case_idx) - return 1; - case_idx += v->nv; - } - return 0; -} - /* Returns value of X truncated to two least-significant digits. */ static int rerange (int x)