summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-08-08 15:43:34 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-08-08 15:43:34 +0100
commit07c79d18a027b43f30fa2370332765e484039ed7 (patch)
treec7dd56cb1ea786898c7ead583181493200013516
parent8e6998a3ab73cb30d6b376b14c343f56a4b2d5cf (diff)
downloadrabbitmq-server-07c79d18a027b43f30fa2370332765e484039ed7.tar.gz
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...
-rw-r--r--src/priority_queue.erl2
1 files changed, 1 insertions, 1 deletions
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) ->