Skip to content

Commit 7558a3d

Browse files
authored
Do not materialize Vector on get size (#53)
1 parent c85c24c commit 7558a3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Pgvector/Npgsql/VectorConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override async ValueTask<Vector> ReadAsync(PgReader reader, CancellationT
5050
}
5151

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

5555
public override void Write(PgWriter writer, Vector value)
5656
{

0 commit comments

Comments
 (0)