{
return NULL;
}
- /*
- C->N_COEFFS == 1 means regression through the origin.
- */
- i = (c->n_coeffs > 1) ? 1 : 0;
- result = c->coeff[i];
+ i = 0;
+ result = c->coeff[0];
tmp = pspp_coeff_get_var (result, 0);
while (tmp != v && i < c->n_coeffs)
{
tmp = pspp_coeff_get_var (result, 0);
i++;
}
- if (i >= c->n_coeffs)
+ if (tmp != v)
{
+ /*
+ Not found.
+ */
return NULL;
}
if (var_is_numeric (v))
result = c->coeff[i];
tmp = pspp_coeff_get_var (result, 0);
}
- if (i == c->n_coeffs)
+ if (i == c->n_coeffs && tmp != v)
{
return NULL;
}