From bb1e5ed98fdda753ab615ef587c243cbe1025b67 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 25 Aug 2023 21:05:18 -0700 Subject: [PATCH] Improved code [skip ci] --- src/hnswutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index 1a3e234..cec8812 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -854,7 +854,6 @@ HnswUpdateConnection(HnswElement element, HnswCandidate * hc, int m, int lc, int { /* Shrink connections */ HnswCandidate *pruned = NULL; - List *c = NIL; /* Load elements on insert */ if (index != NULL) @@ -881,6 +880,8 @@ HnswUpdateConnection(HnswElement element, HnswCandidate * hc, int m, int lc, int if (pruned == NULL) { + List *c = NIL; + /* Add and sort candidates */ for (int i = 0; i < currentNeighbors->length; i++) c = lappend(c, ¤tNeighbors->items[i]);