Skip to content

Commit

Permalink
Fixes ordering issues with the priority mailbox. Resolves #881
Browse files Browse the repository at this point in the history
  • Loading branch information
nvivo committed Apr 21, 2015
1 parent 710b626 commit 9612f6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Akka/Util/ListPriorityQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Envelope Dequeue()
var ci = pi * 2 + 1; // left child index of parent
if (ci > li) break; // no children so done
var rc = ci + 1; // right child
if (rc <= li && _priorityCalculator(_data[rc]).CompareTo(_priorityCalculator(_data[ci])) < 0) // if there is a rc (ci + 1), and it is smaller than left child, use the rc instead
if (rc <= li && _priorityCalculator(_data[rc].Message).CompareTo(_priorityCalculator(_data[ci].Message)) < 0) // if there is a rc (ci + 1), and it is smaller than left child, use the rc instead
ci = rc;
if (_priorityCalculator(_data[pi].Message).CompareTo(_priorityCalculator(_data[ci].Message)) <= 0) break; // parent is smaller than (or equal to) smallest child so done
var tmp = _data[pi]; _data[pi] = _data[ci]; _data[ci] = tmp; // swap parent and child
Expand Down

0 comments on commit 9612f6b

Please sign in to comment.