pgvector.git / summary / log / commit / refs
commit 4d6da72b0881bc32bfa7ed415fb6828be4f448c6
Author: Andrew Kane <andrew@ankane.org>
Date: Thu Aug 10 16:56:17 2023 +0000
Simplified code
src/hnswutils.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/hnswutils.c b/src/hnswutils.c
index d3099097..685e8760 100644
--- a/src/hnswutils.c
+++ b/src/hnswutils.c
@@ -892,7 +892,6 @@ HnswInsertElement(HnswElement element, HnswElement entryPoint, Relation index, F
int level = element->level;
int entryLevel;
Datum q = PointerGetDatum(element->vec);
- HnswElement dup;
BlockNumber *skipPage = vacuuming ? &element->neighborPage : NULL;
OffsetNumber *skipOffno = vacuuming ? &element->neighborOffno : NULL;
bool removeEntryPoint;
@@ -942,12 +941,8 @@ HnswInsertElement(HnswElement element, HnswElement entryPoint, Relation index, F
}
/* Look for duplicates */
- if (level >= 0 && !vacuuming)
- {
- dup = HnswFindDuplicate(element);
- if (dup != NULL)
- return dup;
- }
+ if (!vacuuming)
+ return HnswFindDuplicate(element);
return NULL;
}
[parent: 443c7a5dab56]