From f9d68a061a2e3ceb17573a6662a1c482e5b7b534 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 19 Sep 2024 04:39:46 -0700 Subject: [PATCH] Simplified HnswLoadUnvisitedFromMemory [skip ci] --- src/hnswutils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index d1fb22c..34eb08d 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -749,13 +749,12 @@ HnswLoadUnvisitedFromMemory(char *base, HnswElement element, HnswUnvisited * unv LWLockAcquire(&element->lock, LW_SHARED); memcpy(neighborhoodData, neighborhood, neighborhoodSize); LWLockRelease(&element->lock); - neighborhood = neighborhoodData; *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; AddToVisited(base, v, hc->element, NULL, &found);