diff options
author | Matthias Radestock <matthias@lshift.net> | 2009-04-15 17:48:37 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2009-04-15 17:48:37 +0100 |
commit | 2fc070e4fec26687cfd9af4fd10cf60ce36a0ad4 (patch) | |
tree | 344f7226a472184367fc80d71a437e5fdfcc6e20 /src/priority_queue.erl | |
parent | 627b5bc7237a365add060bb869ab773ca3daa64b (diff) | |
download | rabbitmq-server-2fc070e4fec26687cfd9af4fd10cf60ce36a0ad4.tar.gz |
handle negative prioritiesbug20354
Diffstat (limited to 'src/priority_queue.erl')
-rw-r--r-- | src/priority_queue.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/priority_queue.erl b/src/priority_queue.erl index b872c8d5..88ad0c18 100644 --- a/src/priority_queue.erl +++ b/src/priority_queue.erl @@ -111,6 +111,8 @@ in(X, 0, {queue, [_] = In, []}) -> {queue, [X], In}; in(X, 0, {queue, In, Out}) when is_list(In), is_list(Out) -> {queue, [X|In], Out}; +in(X, Priority, Q = {queue, [], []}) -> + in(X, Priority, {pqueue, []}); in(X, Priority, Q = {queue, _, _}) -> in(X, Priority, {pqueue, [{0, Q}]}); in(X, Priority, {pqueue, Queues}) -> |