From 25d38e705f064b20ad6c521928a97816b3e4483c Mon Sep 17 00:00:00 2001 From: tlatorre Date: Tue, 11 Sep 2018 10:32:31 -0500 Subject: switch order of expressions to avoid a valgrind warning --- src/fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fit.c b/src/fit.c index 2b20683..033e8c7 100644 --- a/src/fit.c +++ b/src/fit.c @@ -302,7 +302,7 @@ int fit_event(event *ev, double *xopt, double *fmin) rv = nlopt_optimize(opt,x,&fval); - if (fval < *fmin || i == 0) { + if (i == 0 || fval < *fmin) { *fmin = fval; memcpy(xopt,x,sizeof(x)); } -- cgit