Skip to content

Commit

Permalink
Updated signature of fromBinary
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 8, 2024
1 parent b7914c3 commit 5e809e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/pgvector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class Pgvector {
if (input is String) {
input = Uint8List.fromList(utf8.encode(input));
}
var bdata = new ByteData.view(input.buffer, input.offsetInBytes);
return Vector.fromBinary(bdata).toList();
return Vector.fromBinary(input).toList();
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/vector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class Vector {

const Vector(this.vec);

factory Vector.fromBinary(ByteData bdata) {
factory Vector.fromBinary(Uint8List bytes) {
var bdata = new ByteData.view(bytes.buffer, bytes.offsetInBytes);
var dim = bdata.getUint16(0);
var unused = bdata.getUint16(2);
if (unused != 0) {
Expand Down

0 comments on commit 5e809e4

Please sign in to comment.