mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 22:56:55 +08:00
Improved variable name [skip ci]
This commit is contained in:
@@ -506,11 +506,11 @@ CreateListPages(Relation index, VectorArray centers, int dimensions,
|
|||||||
Buffer buf;
|
Buffer buf;
|
||||||
Page page;
|
Page page;
|
||||||
GenericXLogState *state;
|
GenericXLogState *state;
|
||||||
Size itemsz;
|
Size listSize;
|
||||||
IvfflatList list;
|
IvfflatList list;
|
||||||
|
|
||||||
itemsz = MAXALIGN(IVFFLAT_LIST_SIZE(dimensions));
|
listSize = MAXALIGN(IVFFLAT_LIST_SIZE(dimensions));
|
||||||
list = palloc(itemsz);
|
list = palloc(listSize);
|
||||||
|
|
||||||
buf = IvfflatNewBuffer(index, forkNum);
|
buf = IvfflatNewBuffer(index, forkNum);
|
||||||
IvfflatInitRegisterPage(index, &buf, &page, &state);
|
IvfflatInitRegisterPage(index, &buf, &page, &state);
|
||||||
@@ -525,11 +525,11 @@ CreateListPages(Relation index, VectorArray centers, int dimensions,
|
|||||||
memcpy(&list->center, VectorArrayGet(centers, i), VECTOR_SIZE(dimensions));
|
memcpy(&list->center, VectorArrayGet(centers, i), VECTOR_SIZE(dimensions));
|
||||||
|
|
||||||
/* Ensure free space */
|
/* Ensure free space */
|
||||||
if (PageGetFreeSpace(page) < itemsz)
|
if (PageGetFreeSpace(page) < listSize)
|
||||||
IvfflatAppendPage(index, &buf, &page, &state, forkNum);
|
IvfflatAppendPage(index, &buf, &page, &state, forkNum);
|
||||||
|
|
||||||
/* Add the item */
|
/* Add the item */
|
||||||
offno = PageAddItem(page, (Item) list, itemsz, InvalidOffsetNumber, false, false);
|
offno = PageAddItem(page, (Item) list, listSize, InvalidOffsetNumber, false, false);
|
||||||
if (offno == InvalidOffsetNumber)
|
if (offno == InvalidOffsetNumber)
|
||||||
elog(ERROR, "failed to add index item to \"%s\"", RelationGetRelationName(index));
|
elog(ERROR, "failed to add index item to \"%s\"", RelationGetRelationName(index));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user