Skip to content

Commit d66457b

Browse files
committed
Fix type instability in make_knn_heaps
1 parent 97c93b3 commit d66457b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ function make_knn_heaps(data::Vector{V},
6464
M <: SemiMetric}
6565
np = length(data)
6666
D = result_type(metric, data[1], data[1])
67-
knn_heaps = [BinaryMaxHeap{NNTuple{Int, D}}() for _ in 1:np]
67+
HeapType = BinaryMaxHeap{NNTuple{Int, D}}
68+
knn_heaps = HeapType[HeapType() for _ in 1:np]
6869
for i in 1:np
6970
k_idxs = sample_neighbors(np, n_neighbors, exclude=[i])
7071
for j in k_idxs

0 commit comments

Comments
 (0)