mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 15:16:54 +08:00
Improved code [skip ci]
This commit is contained in:
@@ -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, ¤tNeighbors->items[i]);
|
c = lappend(c, ¤tNeighbors->items[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user