+ /* Sort the VALMAP here */
+ array = xcalloc (sizeof *array, vn->n_vals);
+ x = 0;
+ HMAP_FOR_EACH (valnd, struct value_node, node, &vn->valmap)
+ {
+ /* Note: This loop is probably superfluous, it could be done in the
+ update stage (at the expense of a realloc) */
+ array[x++] = valnd;
+ }
+
+ sort (array, vn->n_vals, sizeof (*array),
+ compare_value_node_3way, vn);
+
+ for (x = 0; x < vn->n_vals; ++x)
+ {
+ struct value_node *vvv = array[x];
+ vvv->index = x;
+ }
+ free (array);
+
+ cat->iap[i].df_prod[v] = df * (vn->n_vals - 1);