From: Matthew Fernandez Date: Thu, 6 Jan 2022 06:13:16 +0000 (-0800) Subject: lib/mingle: scope use of an array to a local temp X-Git-Tag: 3.0.0~88^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9a5b22e8421c94a4b30079b57799ca6f5ff49bb;p=graphviz lib/mingle: scope use of an array to a local temp Similar to the preceding changes for `sources`, it is not clear to me why this code was using the `targets` array when the output values are irrelevant. --- diff --git a/lib/mingle/ink.cpp b/lib/mingle/ink.cpp index dbf60269b..1fe28c72a 100644 --- a/lib/mingle/ink.cpp +++ b/lib/mingle/ink.cpp @@ -252,11 +252,11 @@ double ink(pedge* edges, int numEdges, int *pick, double *ink0, point_t *meet1, } x = e->x; point_t source = {x[0], x[1]}; - targets[i].x = x[e->dim*e->npoints - e->dim]; - targets[i].y = x[e->dim*e->npoints - e->dim + 1]; - (*ink0) += hypot(source.x - targets[i].x, source.y - targets[i].y); + point_t target = {x[e->dim*e->npoints - e->dim], + x[e->dim*e->npoints - e->dim + 1]}; + (*ink0) += hypot(source.x - target.x, source.y - target.y); begin = addPoint (begin, scalePoint(source, e->wgt)); - end = addPoint (end, scalePoint(targets[i], e->wgt)); + end = addPoint (end, scalePoint(target, e->wgt)); wgt += e->wgt; }