From 4b9e9bd0e1c0454b637ec05f8e7538a74433f467 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 13 Aug 2022 22:55:03 -0700 Subject: [PATCH] refactoring --- src/language/stats/ctables.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/language/stats/ctables.c b/src/language/stats/ctables.c index 8f8d6c885f..5f7162fd2a 100644 --- a/src/language/stats/ctables.c +++ b/src/language/stats/ctables.c @@ -4725,43 +4725,23 @@ ctables_prepare_table (struct ctables_table *t) break; case CTAT_ROW: - if (a == PIVOT_AXIS_COLUMN && t->label_axis[PIVOT_AXIS_ROW] == PIVOT_AXIS_COLUMN) - n_drop = 0; - else if (a == PIVOT_AXIS_COLUMN && t->label_axis[PIVOT_AXIS_COLUMN] == PIVOT_AXIS_ROW) - { - drop_inner = true; - n_drop = 0; - } - else if (a == PIVOT_AXIS_COLUMN && t->label_axis[PIVOT_AXIS_COLUMN] == PIVOT_AXIS_LAYER) - { - drop_inner = true; - n_drop = 0; - } - else - { - n_drop = a == PIVOT_AXIS_COLUMN; - if (a == PIVOT_AXIS_ROW && t->label_axis[PIVOT_AXIS_ROW] == PIVOT_AXIS_COLUMN) - n_drop++; - } - break; - case CTAT_COL: - if (a == PIVOT_AXIS_ROW && t->label_axis[PIVOT_AXIS_ROW] == PIVOT_AXIS_COLUMN) + if (a == atb && t->label_axis[ata] == atb) + n_drop = 0; + else if (a == atb && t->label_axis[atb] == ata) { drop_inner = true; n_drop = 0; } - else if (a == PIVOT_AXIS_ROW && t->label_axis[PIVOT_AXIS_COLUMN] == PIVOT_AXIS_ROW) - n_drop = 0; - else if (a == PIVOT_AXIS_ROW && t->label_axis[PIVOT_AXIS_ROW] == PIVOT_AXIS_LAYER) + else if (a == atb && t->label_axis[atb] == PIVOT_AXIS_LAYER) { drop_inner = true; n_drop = 0; } else { - n_drop = a == PIVOT_AXIS_ROW; - if (a == PIVOT_AXIS_COLUMN && t->label_axis[PIVOT_AXIS_COLUMN] == PIVOT_AXIS_ROW) + n_drop = a == atb; + if (a == ata && t->label_axis[ata] == atb) n_drop++; } break; -- 2.30.2