From d0cc8d3a5cfb2d8b35d1fb146f6cc913e7ba05de Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 6 Mar 2022 14:50:21 -0800 Subject: [PATCH] topfish compute_densities: rephrase an open coded 'hypot' --- lib/topfish/rescale_layout.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/topfish/rescale_layout.c b/lib/topfish/rescale_layout.c index fe5165a68..30c763e1f 100644 --- a/lib/topfish/rescale_layout.c +++ b/lib/topfish/rescale_layout.c @@ -44,9 +44,7 @@ static double *compute_densities(v_data * graph, int n, double *x, sum = 0; for (j = 1; j < graph[i].nedges; j++) { neighbor = graph[i].edges[j]; - sum += - sqrt((x[i] - x[neighbor]) * (x[i] - x[neighbor]) + - (y[i] - y[neighbor]) * (y[i] - y[neighbor])); + sum += hypot(x[i] - x[neighbor], y[i] - y[neighbor]); } densities[i] = sum / graph[i].nedges; } -- 2.40.0