mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 16:16:56 +08:00
Simplified HnswLoadUnvisitedFromMemory [skip ci]
This commit is contained in:
@@ -749,13 +749,12 @@ HnswLoadUnvisitedFromMemory(char *base, HnswElement element, HnswUnvisited * unv
|
|||||||
LWLockAcquire(&element->lock, LW_SHARED);
|
LWLockAcquire(&element->lock, LW_SHARED);
|
||||||
memcpy(neighborhoodData, neighborhood, neighborhoodSize);
|
memcpy(neighborhoodData, neighborhood, neighborhoodSize);
|
||||||
LWLockRelease(&element->lock);
|
LWLockRelease(&element->lock);
|
||||||
neighborhood = neighborhoodData;
|
|
||||||
|
|
||||||
*unvisitedLength = 0;
|
*unvisitedLength = 0;
|
||||||
|
|
||||||
for (int i = 0; i < neighborhood->length; i++)
|
for (int i = 0; i < neighborhoodData->length; i++)
|
||||||
{
|
{
|
||||||
HnswCandidate *hc = &neighborhood->items[i];
|
HnswCandidate *hc = &neighborhoodData->items[i];
|
||||||
bool found;
|
bool found;
|
||||||
|
|
||||||
AddToVisited(base, v, hc->element, NULL, &found);
|
AddToVisited(base, v, hc->element, NULL, &found);
|
||||||
|
|||||||
Reference in New Issue
Block a user