projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make cases simpler, faster, and easier to understand.
[pspp-builds.git]
/
src
/
math
/
merge.c
diff --git
a/src/math/merge.c
b/src/math/merge.c
index b84122982e04f19fedaf1c2a0e542e58214546d0..2ff57c6e5ba6fa0a88a9237f95782cb55332bbd6 100644
(file)
--- a/
src/math/merge.c
+++ b/
src/math/merge.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-36,7
+36,7
@@
struct merge_input
{
struct casereader *reader;
struct merge_input
{
struct casereader *reader;
- struct ccase c;
+ struct ccase
*
c;
};
struct merge
};
struct merge
@@
-111,7
+111,8
@@
read_input_case (struct merge *m, size_t idx)
{
struct merge_input *i = &m->inputs[idx];
{
struct merge_input *i = &m->inputs[idx];
- if (casereader_read (i->reader, &i->c))
+ i->c = casereader_read (i->reader);
+ if (i->c)
return true;
else
{
return true;
else
{
@@
-144,11
+145,11
@@
do_merge (struct merge *m)
min = 0;
for (i = 1; i < m->input_cnt; i++)
min = 0;
for (i = 1; i < m->input_cnt; i++)
- if (subcase_compare_3way (&m->ordering,
&
m->inputs[i].c,
- &m->ordering,
&
m->inputs[min].c) < 0)
+ if (subcase_compare_3way (&m->ordering, m->inputs[i].c,
+ &m->ordering, m->inputs[min].c) < 0)
min = i;
min = i;
- casewriter_write (w,
&
m->inputs[min].c);
+ casewriter_write (w, m->inputs[min].c);
read_input_case (m, min);
}
read_input_case (m, min);
}