@@ -669,11 +669,11 @@ InitVisited(char *base, visited_hash * v, Relation index, int ef, int m)
669669 * Add to visited
670670 */
671671static inline void
672- AddToVisited (char * base ,visited_hash * v ,HnswCandidate * hc ,Relation index ,bool * found )
672+ AddToVisited (char * base ,visited_hash * v ,HnswElementPtr elementPtr ,Relation index ,bool * found )
673673{
674674if (index != NULL )
675675{
676- HnswElement element = HnswPtrAccess (base ,hc -> element );
676+ HnswElement element = HnswPtrAccess (base ,elementPtr );
677677ItemPointerData indextid ;
678678
679679ItemPointerSet (& indextid ,element -> blkno ,element -> offno );
@@ -682,21 +682,21 @@ AddToVisited(char *base, visited_hash * v, HnswCandidate * hc, Relation index, b
682682else if (base != NULL )
683683{
684684#if PG_VERSION_NUM >=130000
685- HnswElement element = HnswPtrAccess (base ,hc -> element );
685+ HnswElement element = HnswPtrAccess (base ,elementPtr );
686686
687- offsethash_insert_hash (v -> offsets ,HnswPtrOffset (hc -> element ),element -> hash ,found );
687+ offsethash_insert_hash (v -> offsets ,HnswPtrOffset (elementPtr ),element -> hash ,found );
688688#else
689- offsethash_insert (v -> offsets ,HnswPtrOffset (hc -> element ),found );
689+ offsethash_insert (v -> offsets ,HnswPtrOffset (elementPtr ),found );
690690#endif
691691}
692692else
693693{
694694#if PG_VERSION_NUM >=130000
695- HnswElement element = HnswPtrAccess (base ,hc -> element );
695+ HnswElement element = HnswPtrAccess (base ,elementPtr );
696696
697- pointerhash_insert_hash (v -> pointers , (uintptr_t )HnswPtrPointer (hc -> element ),element -> hash ,found );
697+ pointerhash_insert_hash (v -> pointers , (uintptr_t )HnswPtrPointer (elementPtr ),element -> hash ,found );
698698#else
699- pointerhash_insert (v -> pointers , (uintptr_t )HnswPtrPointer (hc -> element ),found );
699+ pointerhash_insert (v -> pointers , (uintptr_t )HnswPtrPointer (elementPtr ),found );
700700#endif
701701}
702702}
@@ -738,7 +738,7 @@ HnswLoadUnvisitedFromMemory(char *base, HnswElement element, HnswElement * unvis
738738HnswCandidate * hc = & neighborhood -> items [i ];
739739bool found ;
740740
741- AddToVisited (base ,v ,hc ,NULL ,& found );
741+ AddToVisited (base ,v ,hc -> element ,NULL ,& found );
742742
743743if (!found )
744744unvisited [(* unvisitedLength )++ ]= HnswPtrAccess (base ,hc -> element );
@@ -820,7 +820,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
820820bool found ;
821821HnswPairingHeapNode * node ;
822822
823- AddToVisited (base ,& v ,hc ,index ,& found );
823+ AddToVisited (base ,& v ,hc -> element ,index ,& found );
824824
825825node = CreatePairingHeapNode (hc );
826826pairingheap_add (C ,& node -> c_node );