mirror of
https://github.com/pgvector/pgvector.git
synced 2026-12-04 00:08:30 +00:00
Improved random_sparsevec subroutine [skip ci]
This commit is contained in:
1 parent
aced364bb2
commit
fcbcbaf45c
1 file changed
+1
-1
@@ -19,7 +19,7 @@ sub random_sparsevec
|
||||
my ($nnz) = @_;
|
||||
my @elements;
|
||||
my %indices;
|
||||
while (keys %indices < $nnz)
|
||||
while (@elements < $nnz)
|
||||
{
|
||||
my $index = int(rand(100000)) + 1;
|
||||
if (!exists($indices{$index}))
|
||||
|
||||
Reference in new issue
Block a user