From 07c79d18a027b43f30fa2370332765e484039ed7 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Fri, 8 Aug 2014 15:43:34 +0100 Subject: Fix typo spotted by Edwin Fine. Since hitting this line would cause a crash in the caller, and since this code is used very heavily (e.g. in the gen_server2 prioritised mailbox) and since it's been like that for over a year, I can only conclude that this code is unreachable. That conclusion is backed up by trying to get a pqueue() into a state which would hit that head - I was not able to. Still, it should be fixed... --- src/priority_queue.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/priority_queue.erl b/src/priority_queue.erl index 9a578aa9..a3573bbd 100644 --- a/src/priority_queue.erl +++ b/src/priority_queue.erl @@ -139,7 +139,7 @@ out({queue, [V], [], 1}) -> {{value, V}, {queue, [], [], 0}}; out({queue, [Y|In], [], Len}) -> [V|Out] = lists:reverse(In, []), - {{value, V}, {queue, [Y], Out}, Len - 1}; + {{value, V}, {queue, [Y], Out, Len - 1}}; out({queue, In, [V], Len}) when is_list(In) -> {{value,V}, r2f(In, Len - 1)}; out({queue, In,[V|Out], Len}) when is_list(In) -> -- cgit v1.2.1