struct ccase trns_case; /* Case used for transformations. */
struct ccase sink_case; /* Case written to sink, if
- compaction is necessary. */
+ compacting is necessary. */
size_t cases_written; /* Cases output so far. */
};
if (permanent_dict == NULL)
permanent_dict = default_dict;
- /* Figure out compaction. */
- compactor = (dict_needs_compaction (permanent_dict)
+ /* Figure out whether to compact. */
+ compactor = (dict_compacting_would_shrink (permanent_dict)
? dict_make_compactor (permanent_dict)
: NULL);
/* Dictionary from before TEMPORARY becomes permanent. */
proc_cancel_temporary_transformations ();
- /* Finish compaction. */
+ /* Finish compacting. */
if (compactor != NULL)
{
dict_compactor_destroy (compactor);
/* Represents auxiliary data for handling SPLIT FILE. */
struct split_aux_data
{
- size_t case_count; /* Number of cases so far. */
struct ccase prev_case; /* Data in previous case. */
/* Callback functions. */
struct split_aux_data split_aux;
bool ok;
- split_aux.case_count = 0;
case_nullify (&split_aux.prev_case);
split_aux.begin_func = begin_func;
split_aux.proc_func = proc_func;
struct split_aux_data *split_aux = split_aux_;
/* Start a new series if needed. */
- if (split_aux->case_count == 0
+ if (case_is_null (&split_aux->prev_case)
|| !equal_splits (c, &split_aux->prev_case))
{
- if (split_aux->case_count > 0 && split_aux->end_func != NULL)
+ if (!case_is_null (&split_aux->prev_case) && split_aux->end_func != NULL)
split_aux->end_func (split_aux->func_aux);
case_destroy (&split_aux->prev_case);
split_aux->begin_func (&split_aux->prev_case, split_aux->func_aux);
}
- split_aux->case_count++;
return (split_aux->proc_func == NULL
|| split_aux->proc_func (c, split_aux->func_aux));
}
{
struct split_aux_data *split_aux = split_aux_;
- if (split_aux->case_count > 0 && split_aux->end_func != NULL)
+ if (!case_is_null (&split_aux->prev_case) && split_aux->end_func != NULL)
split_aux->end_func (split_aux->func_aux);
return true;
}
proc_done (void)
{
discard_variables ();
+ dict_destroy (default_dict);
}
/* Sets SINK as the destination for procedure output from the