From: Matthew Fernandez Date: Sun, 1 Jan 2023 21:17:52 +0000 (-0800) Subject: sparse QuadTree_get_supernodes_internal: remove redundant branch X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa2a0e04bb530970f377b006e33e0ee2ba01a886;p=graphviz sparse QuadTree_get_supernodes_internal: remove redundant branch --- diff --git a/lib/sparse/QuadTree.c b/lib/sparse/QuadTree.c index 5917fe9a5..d27722e39 100644 --- a/lib/sparse/QuadTree.c +++ b/lib/sparse/QuadTree.c @@ -85,20 +85,18 @@ static void QuadTree_get_supernodes_internal(QuadTree qt, double bh, double *pt, if (!qt) return; dim = qt->dim; l = qt->l; - if (l){ - while (l){ - check_or_realloc_arrays(dim, nsuper, nsupermax, center, supernode_wgts, distances); - if (node_data_get_id(SingleLinkedList_get_data(l)) != nodeid){ - coord = node_data_get_coord(SingleLinkedList_get_data(l)); - for (i = 0; i < dim; i++){ - (*center)[dim*(*nsuper)+i] = coord[i]; - } - (*supernode_wgts)[*nsuper] = node_data_get_weight(SingleLinkedList_get_data(l)); - (*distances)[*nsuper] = point_distance(pt, coord, dim); - (*nsuper)++; + while (l) { + check_or_realloc_arrays(dim, nsuper, nsupermax, center, supernode_wgts, distances); + if (node_data_get_id(SingleLinkedList_get_data(l)) != nodeid){ + coord = node_data_get_coord(SingleLinkedList_get_data(l)); + for (i = 0; i < dim; i++){ + (*center)[dim*(*nsuper)+i] = coord[i]; } - l = SingleLinkedList_get_next(l); + (*supernode_wgts)[*nsuper] = node_data_get_weight(SingleLinkedList_get_data(l)); + (*distances)[*nsuper] = point_distance(pt, coord, dim); + (*nsuper)++; } + l = SingleLinkedList_get_next(l); } if (qt->qts){