@@ -1104,17 +1104,17 @@ LoadElementsForInsert(HnswNeighborArray * neighbors, Datum q, HnswCandidate * *p
1104
1104
* Update connections
1105
1105
*/
1106
1106
void
1107
- HnswUpdateConnection (char * base , HnswElement element , HnswCandidate * hc , HnswNeighborArray * currentNeighbors , int lm , int * updateIdx , Relation index , FmgrInfo * procinfo , Oid collation )
1107
+ HnswUpdateConnection (char * base , HnswElement element , HnswCandidate * hc , HnswNeighborArray * neighbors , int lm , int * updateIdx , Relation index , FmgrInfo * procinfo , Oid collation )
1108
1108
{
1109
1109
HnswElement hce = HnswPtrAccess (base , hc -> element );
1110
- HnswCandidate hc2 ;
1110
+ HnswCandidate newHc ;
1111
1111
1112
- HnswPtrStore (base , hc2 .element , element );
1113
- hc2 .distance = hc -> distance ;
1112
+ HnswPtrStore (base , newHc .element , element );
1113
+ newHc .distance = hc -> distance ;
1114
1114
1115
- if (currentNeighbors -> length < lm )
1115
+ if (neighbors -> length < lm )
1116
1116
{
1117
- currentNeighbors -> items [currentNeighbors -> length ++ ] = hc2 ;
1117
+ neighbors -> items [neighbors -> length ++ ] = newHc ;
1118
1118
1119
1119
/* Track update */
1120
1120
if (updateIdx != NULL )
@@ -1127,30 +1127,30 @@ HnswUpdateConnection(char *base, HnswElement element, HnswCandidate * hc, HnswNe
1127
1127
1128
1128
/* Load elements on insert */
1129
1129
if (index != NULL )
1130
- LoadElementsForInsert (currentNeighbors , HnswGetValue (base , hce ), & pruned , index , procinfo , collation );
1130
+ LoadElementsForInsert (neighbors , HnswGetValue (base , hce ), & pruned , index , procinfo , collation );
1131
1131
1132
1132
if (pruned == NULL )
1133
1133
{
1134
1134
List * c = NIL ;
1135
1135
1136
1136
/* Add candidates */
1137
- for (int i = 0 ; i < currentNeighbors -> length ; i ++ )
1138
- c = lappend (c , & currentNeighbors -> items [i ]);
1139
- c = lappend (c , & hc2 );
1137
+ for (int i = 0 ; i < neighbors -> length ; i ++ )
1138
+ c = lappend (c , & neighbors -> items [i ]);
1139
+ c = lappend (c , & newHc );
1140
1140
1141
- SelectNeighbors (base , c , lm , procinfo , collation , currentNeighbors , & hc2 , & pruned , true);
1141
+ SelectNeighbors (base , c , lm , procinfo , collation , neighbors , & newHc , & pruned , true);
1142
1142
1143
1143
/* Should not happen */
1144
1144
if (pruned == NULL )
1145
1145
return ;
1146
1146
}
1147
1147
1148
1148
/* Find and replace the pruned element */
1149
- for (int i = 0 ; i < currentNeighbors -> length ; i ++ )
1149
+ for (int i = 0 ; i < neighbors -> length ; i ++ )
1150
1150
{
1151
- if (HnswPtrEqual (base , currentNeighbors -> items [i ].element , pruned -> element ))
1151
+ if (HnswPtrEqual (base , neighbors -> items [i ].element , pruned -> element ))
1152
1152
{
1153
- currentNeighbors -> items [i ] = hc2 ;
1153
+ neighbors -> items [i ] = newHc ;
1154
1154
1155
1155
/* Track update */
1156
1156
if (updateIdx != NULL )
0 commit comments