From d771a46818ac407bebc5b53d177d330e9409c361 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 29 Jul 2022 17:42:04 -0700 Subject: [PATCH] sparse QuadTree_get_nearest_internal: remove 'flag' parameter This is always set to 0 and conveys no information to the caller. --- lib/sparse/QuadTree.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/sparse/QuadTree.c b/lib/sparse/QuadTree.c index 19b697505..c2d6f1c21 100644 --- a/lib/sparse/QuadTree.c +++ b/lib/sparse/QuadTree.c @@ -661,7 +661,7 @@ void QuadTree_print(FILE *fp, QuadTree q){ -static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, double *min, int *imin, int tentative, int *flag){ +static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, double *min, int *imin, int tentative){ /* get the narest point years to {x[0], ..., x[dim]} and store in y.*/ SingleLinkedList l; double *coord, dist; @@ -669,7 +669,6 @@ static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, dou double qmin; double *point = x; - *flag = 0; if (!qt) return; dim = qt->dim; l = qt->l; @@ -702,10 +701,10 @@ static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, dou } } assert(iq >= 0); - QuadTree_get_nearest_internal(qt->qts[iq], x, y, min, imin, tentative, flag); + QuadTree_get_nearest_internal(qt->qts[iq], x, y, min, imin, tentative); } else { for (i = 0; i < 1<qts[i], x, y, min, imin, tentative, flag); + QuadTree_get_nearest_internal(qt->qts[i], x, y, min, imin, tentative); } } } @@ -719,9 +718,6 @@ void QuadTree_get_nearest(QuadTree qt, double *x, double *ymin, int *imin, doubl *flag = 0; *min = -1; - QuadTree_get_nearest_internal(qt, x, ymin, min, imin, TRUE, flag); - - QuadTree_get_nearest_internal(qt, x, ymin, min, imin, FALSE, flag); - - + QuadTree_get_nearest_internal(qt, x, ymin, min, imin, TRUE); + QuadTree_get_nearest_internal(qt, x, ymin, min, imin, FALSE); } -- 2.40.0