Skip to content

Commit 8e1853f

Browse files
committed
Improved variable name [skip ci]
1 parent f9d68a0 commit 8e1853f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/hnswutils.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -740,21 +740,21 @@ CountElement(HnswElement skipElement, HnswElement e)
740740
* Load unvisited neighbors from memory
741741
*/
742742
static void
743-
HnswLoadUnvisitedFromMemory(char *base, HnswElement element, HnswUnvisited * unvisited, int *unvisitedLength, visited_hash * v, int lc, HnswNeighborArray * neighborhoodData, Size neighborhoodSize)
743+
HnswLoadUnvisitedFromMemory(char *base, HnswElement element, HnswUnvisited * unvisited, int *unvisitedLength, visited_hash * v, int lc, HnswNeighborArray * localNeighborhood, Size neighborhoodSize)
744744
{
745745
/* Get the neighborhood at layer lc */
746746
HnswNeighborArray *neighborhood = HnswGetNeighbors(base, element, lc);
747747

748748
/* Copy neighborhood to local memory */
749749
LWLockAcquire(&element->lock, LW_SHARED);
750-
memcpy(neighborhoodData, neighborhood, neighborhoodSize);
750+
memcpy(localNeighborhood, neighborhood, neighborhoodSize);
751751
LWLockRelease(&element->lock);
752752

753753
*unvisitedLength = 0;
754754

755-
for (int i = 0; i < neighborhoodData->length; i++)
755+
for (int i = 0; i < localNeighborhood->length; i++)
756756
{
757-
HnswCandidate *hc = &neighborhoodData->items[i];
757+
HnswCandidate *hc = &localNeighborhood->items[i];
758758
bool found;
759759

760760
AddToVisited(base, v, hc->element, NULL, &found);
@@ -817,7 +817,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
817817
int wlen = 0;
818818
visited_hash v;
819819
ListCell *lc2;
820-
HnswNeighborArray *neighborhoodData = NULL;
820+
HnswNeighborArray *localNeighborhood = NULL;
821821
Size neighborhoodSize = 0;
822822
int lm = HnswGetLayerM(m, lc);
823823
HnswUnvisited *unvisited = palloc(lm * sizeof(HnswUnvisited));
@@ -829,7 +829,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
829829
if (index == NULL)
830830
{
831831
neighborhoodSize = HNSW_NEIGHBOR_ARRAY_SIZE(lm);
832-
neighborhoodData = palloc(neighborhoodSize);
832+
localNeighborhood = palloc(neighborhoodSize);
833833
}
834834

835835
/* Add entry points to v, C, and W */
@@ -866,7 +866,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
866866
cElement = HnswPtrAccess(base, c->element);
867867

868868
if (index == NULL)
869-
HnswLoadUnvisitedFromMemory(base, cElement, unvisited, &unvisitedLength, &v, lc, neighborhoodData, neighborhoodSize);
869+
HnswLoadUnvisitedFromMemory(base, cElement, unvisited, &unvisitedLength, &v, lc, localNeighborhood, neighborhoodSize);
870870
else
871871
HnswLoadUnvisitedFromDisk(cElement, unvisited, &unvisitedLength, &v, index, m, lm, lc);
872872

0 commit comments

Comments
 (0)