From 6d6a88bc595e77267b60d3e891c983152cf19b53 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 26 Jun 2021 16:21:16 -0700 Subject: [PATCH] remove unnecessary not-null guards on free in spring_electrical_embedding_fast It is well-defined to free null. --- lib/sfdpgen/spring_electrical.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/sfdpgen/spring_electrical.c b/lib/sfdpgen/spring_electrical.c index 6f192c320..a6cfd9c48 100644 --- a/lib/sfdpgen/spring_electrical.c +++ b/lib/sfdpgen/spring_electrical.c @@ -659,13 +659,11 @@ void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrica oned_optimizer_delete(qtree_level_optimizer); ctrl->max_qtree_level = max_qtree_level; - if (xold) FREE(xold); + FREE(xold); if (A != A0) SparseMatrix_delete(A); - if (force) FREE(force); - + FREE(force); } - static void spring_electrical_embedding_slow(int dim, SparseMatrix A0, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){ /* a version that does vertex moves in one go, instead of one at a time, use for debugging the fast version. Quadtree is not used. */ /* x is a point to a 1D array, x[i*dim+j] gives the coordinate of the i-th node at dimension j. */ -- 2.40.0