There may be a little mistake in contrib/BoundedPriorityQueues.jl file when you define the function DataStructures.enqueue!, which results in return value of -1 all the time.
function DataStructures.enqueue!(q::BoundedPriorityQueue{K,V}, k::K, v::V;
make_copy::Bool=false) where {K,V}
haskey(q.pq, k) && return -1 #keys must be unique, return -1 if collision
if make_copy
k = deepcopy(k)
end
n = length(q.pq)
enqueue!(q.pq, k, v)
n_add = n - length(q.pq) #number of items added
while length(q.pq) > q.N
dequeue!(q.pq)
end
n_add
end
There may be a little mistake in
contrib/BoundedPriorityQueues.jl
file when you define the functionDataStructures.enqueue!
, which results in return value of -1 all the time.I guess the mistake is made in line 59:
and it should be