From 4fb32ac18c703c1aa36e344f9261c9e5ae165cd4 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 26 Jun 2021 16:19:44 -0700 Subject: [PATCH] remove unnecessary not-null guards to free in Operator_diag_precon_delete It is well-defined to free null. Apart from this though, the first condition containing a dereference of `o` implies that `o` is not null so the second condition can be assumed true. --- lib/sfdpgen/sparse_solve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sfdpgen/sparse_solve.c b/lib/sfdpgen/sparse_solve.c index 49bcd21d4..e68e8db17 100644 --- a/lib/sfdpgen/sparse_solve.c +++ b/lib/sfdpgen/sparse_solve.c @@ -147,8 +147,8 @@ static Operator Operator_diag_precon_new(SparseMatrix A){ } static void Operator_diag_precon_delete(Operator o){ - if (o->data) FREE(o->data); - if (o) FREE(o); + FREE(o->data); + FREE(o); } static real conjugate_gradient(Operator A, Operator precon, int n, real *x, real *rhs, real tol, int maxit){ -- 2.50.1