Skip to content

Commit 6129125

Browse files
committed
Reduced allocations for halfvec
1 parent 7558a3d commit 6129125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Pgvector/Npgsql/HalfvecConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override async ValueTask<HalfVector> ReadAsync(PgReader reader, Cancellat
5252
}
5353

5454
public override Size GetSize(SizeContext context, HalfVector value, ref object? writeState)
55-
=> sizeof(ushort) * 2 + sizeof(ushort) * value.ToArray().Length;
55+
=> sizeof(ushort) * 2 + sizeof(ushort) * value.Memory.Length;
5656

5757
public override void Write(PgWriter writer, HalfVector value)
5858
{

0 commit comments

Comments
 (0)