aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-09-11 10:32:31 -0500
committertlatorre <tlatorre@uchicago.edu>2018-09-11 10:32:31 -0500
commit25d38e705f064b20ad6c521928a97816b3e4483c (patch)
treec573ab28a7d9283733ed4ea701951f3ba1e3f6fc
parent6c301eb1957ac4dd92fbb19589e7d8b9239b4832 (diff)
downloadsddm-25d38e705f064b20ad6c521928a97816b3e4483c.tar.gz
sddm-25d38e705f064b20ad6c521928a97816b3e4483c.tar.bz2
sddm-25d38e705f064b20ad6c521928a97816b3e4483c.zip
switch order of expressions to avoid a valgrind warning
-rw-r--r--src/fit.c2
1 files changed, 1 insertions, 1 deletions
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));
}