pgvector.git / summary / log / commit / refs
commit bb1e5ed98fdda753ab615ef587c243cbe1025b67
Author: Andrew Kane <andrew@ankane.org>
Date: Sat Aug 26 04:05:18 2023 +0000
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 1a3e234e..cec8812b 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]);
[parent: 8801832946af]