projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math: Avoid unneeded extra allocations for fixed-size data structures.
[pspp]
/
src
/
math
/
trimmed-mean.c
diff --git
a/src/math/trimmed-mean.c
b/src/math/trimmed-mean.c
index b643651a26aa4240e0340768b32af1c3ed37a320..4840fd2d66e0375a6114e3585fc5795b9acf60d7 100644
(file)
--- a/
src/math/trimmed-mean.c
+++ b/
src/math/trimmed-mean.c
@@
-44,8
+44,6
@@
static void
destroy (struct statistic *s)
{
struct trimmed_mean *tm = UP_CAST (s, struct trimmed_mean, parent.parent);
destroy (struct statistic *s)
{
struct trimmed_mean *tm = UP_CAST (s, struct trimmed_mean, parent.parent);
- struct order_stats *os = &tm->parent;
- free (os->k);
free (tm);
}
free (tm);
}
@@
-57,7
+55,7
@@
trimmed_mean_create (double W, double tail)
struct statistic *stat = &os->parent;
os->n_k = 2;
struct statistic *stat = &os->parent;
os->n_k = 2;
- os->k =
xcalloc (2, sizeof (*os->k))
;
+ os->k =
tm->k
;
assert (tail >= 0);
assert (tail <= 1);
assert (tail >= 0);
assert (tail <= 1);