projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3640237
)
pivot-table: fix split file support
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 14 Aug 2022 22:51:41 +0000
(15:51 -0700)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 14 Aug 2022 22:51:41 +0000
(15:51 -0700)
src/output/pivot-table.c
patch
|
blob
|
history
diff --git
a/src/output/pivot-table.c
b/src/output/pivot-table.c
index ec652e50de0b532e1230a93941369a99e3cdb7c1..f81be9df22576755d4cb532e7697f01085789fd2 100644
(file)
--- a/
src/output/pivot-table.c
+++ b/
src/output/pivot-table.c
@@
-3165,7
+3165,7
@@
pivot_splits_new_split (struct pivot_splits *ps, const struct ccase *example)
if (!ps)
return;
if (!ps)
return;
- size_t n_
new
= 0;
+ size_t n_
changed
= 0;
for (size_t i = 0; i < ps->n; i++)
{
struct pivot_splits_var *psvar = &ps->vars[i];
for (size_t i = 0; i < ps->n; i++)
{
struct pivot_splits_var *psvar = &ps->vars[i];
@@
-3180,13
+3180,16
@@
pivot_splits_new_split (struct pivot_splits *ps, const struct ccase *example)
psval->leaf = pivot_category_create_leaf (
psvar->dimension->root,
pivot_value_new_var_value (psvar->var, value));
psval->leaf = pivot_category_create_leaf (
psvar->dimension->root,
pivot_value_new_var_value (psvar->var, value));
- n_new++;
}
}
- ps->dindexes[i] = psval->leaf;
+ if (ps->dindexes[i] != psval->leaf)
+ {
+ ps->dindexes[i] = psval->leaf;
+ n_changed++;
+ }
}
}
- if (!n_
new
)
+ if (!n_
changed
)
{
if (ps->warnings_left-- > 0)
{
{
if (ps->warnings_left-- > 0)
{
@@
-3231,7
+3234,7
@@
pivot_splits_get_dindexes (const struct pivot_splits *ps, size_t *dindexes)
assert (ps->dindexes[0] != SIZE_MAX);
for (size_t i = 0; i < ps->n; i++)
assert (ps->dindexes[0] != SIZE_MAX);
for (size_t i = 0; i < ps->n; i++)
- dindexes[
i
] = ps->dindexes[i];
+ dindexes[
ps->n - i - 1
] = ps->dindexes[i];
return ps->n;
}
return ps->n;
}