Improved code [skip ci]

This commit is contained in:
Andrew Kane
2023-08-25 21:05:18 -07:00
parent 8801832946
commit bb1e5ed98f

View File

@@ -854,7 +854,6 @@ HnswUpdateConnection(HnswElement element, HnswCandidate * hc, int m, int lc, int
{ {
/* Shrink connections */ /* Shrink connections */
HnswCandidate *pruned = NULL; HnswCandidate *pruned = NULL;
List *c = NIL;
/* Load elements on insert */ /* Load elements on insert */
if (index != NULL) if (index != NULL)
@@ -881,6 +880,8 @@ HnswUpdateConnection(HnswElement element, HnswCandidate * hc, int m, int lc, int
if (pruned == NULL) if (pruned == NULL)
{ {
List *c = NIL;
/* Add and sort candidates */ /* Add and sort candidates */
for (int i = 0; i < currentNeighbors->length; i++) for (int i = 0; i < currentNeighbors->length; i++)
c = lappend(c, &currentNeighbors->items[i]); c = lappend(c, &currentNeighbors->items[i]);