Skip to content

Commit 326cff5

Browse files
committed
Improved code [skip ci]
1 parent fdd559a commit 326cff5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pgvector/sparsevec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ def from_binary(cls, value: bytes) -> SparseVector:
136136
if unused != 0:
137137
raise ValueError('expected unused to be 0')
138138

139-
indices = unpack_from(f'>{nnz}i', value, 12)
140-
values = unpack_from(f'>{nnz}f', value, 12 + nnz * 4)
141-
return cls._from_parts(int(dim), list(indices), list(values))
139+
indices = list(unpack_from(f'>{nnz}i', value, 12))
140+
values = list(unpack_from(f'>{nnz}f', value, 12 + nnz * 4))
141+
return cls._from_parts(dim, indices, values)
142142

143143
@classmethod
144144
def _from_parts(cls, dim: int, indices: list[int], values: list[float]) -> SparseVector:

0 commit comments

Comments
 (0)