Skip to content

Commit

Permalink
tweak for "join" fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AllinCottrell committed Jan 23, 2025
1 parent 49d7d2c commit 86e7ed2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/src/gretl_join.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,7 @@ static int binsearch (keynum targ, const keynum *vals, int n, int offset)
not, return 0.
*/

static int aggr_val_determined (joiner *jr, int n, int ntotal,
double *x, int *err)
static int aggr_val_determined (joiner *jr, int n, double *x, int *err)
{
if (jr->aggr == AGGR_COUNT) {
/* just return the number of matches */
Expand All @@ -962,10 +961,6 @@ static int aggr_val_determined (joiner *jr, int n, int ntotal,
"method for a 1:n join"));
*x = NADBL;
return 1;
} else if (ntotal == 0 && jr->aggr == AGGR_NONE) {
fprintf(stderr, "aggr_val_determined ? ntotal = 0\n");
*x = NADBL;
return 1;
} else {
/* not enough information so far */
return 0;
Expand Down Expand Up @@ -1049,7 +1044,7 @@ static double aggr_value (joiner *jr,
if (jr->n_keys == 1) {
/* if there's just a single key, we can figure some
cases out already */
if (aggr_val_determined(jr, n, -1, &x, err)) {
if (aggr_val_determined(jr, n, &x, err)) {
return x;
}
}
Expand Down Expand Up @@ -1153,7 +1148,7 @@ static double aggr_value (joiner *jr,
return NADBL;
}
/* we've already checked this for the 1-key case */
if (aggr_val_determined(jr, n, ntotal, &x, err)) {
if (aggr_val_determined(jr, n, &x, err)) {
return x;
}
}
Expand Down

0 comments on commit 86e7ed2

Please sign in to comment.