-summarize:
- for (size_t i = 0; i < ss->n_summaries; i++)
- ctables_summary_add (&f->summaries[i], &ss->summaries[i], ss->summary_var,
- case_data (c, ss->summary_var), weight);
+ {
+ const struct ctables_summary_spec_set *sss
+ = (cell->total ? &ss->total_sss : &ss->cell_sss);
+ cell->summaries = xmalloc (sss->n * sizeof *cell->summaries);
+ for (size_t i = 0; i < sss->n; i++)
+ ctables_summary_init (&cell->summaries[i], &sss->summaries[i]);
+ }
+ for (enum ctables_domain_type dt = 0; dt < N_CTDTS; dt++)
+ cell->domains[dt] = ctables_domain_insert (t, cell, dt);
+ hmap_insert (&t->cells, &cell->node, hash);
+
+summarize: ;
+ const struct ctables_summary_spec_set *sss
+ = (cell->total ? &ss->total_sss : &ss->cell_sss);
+ for (size_t i = 0; i < sss->n; i++)
+ ctables_summary_add (&cell->summaries[i], &sss->summaries[i], sss->var,
+ case_data (c, sss->var), weight);