From 4bc761607b386ee97233008eed65a92faef488b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Thi=C3=A9baut?= Date: Tue, 4 Oct 2022 15:39:58 +0200 Subject: [PATCH] setindex! returns priority queue To follow the abstract dictionary API, `setindex!` shall return the priority queue when applied to such objects. This also fixes pushing of multiple items with `push!`. --- src/priorityqueue.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/priorityqueue.jl b/src/priorityqueue.jl index b73d0d402..7aae4c06c 100644 --- a/src/priorityqueue.jl +++ b/src/priorityqueue.jl @@ -247,7 +247,7 @@ function Base.setindex!(pq::PriorityQueue{K, V}, value, key) where {K,V} else push!(pq, key=>value) end - return value + return pq end """