Skip to content

Commit

Permalink
Update PriorityMessageQueue.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Dec 5, 2018
1 parent 6f8189a commit 5294a14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions neo/IO/Actors/PriorityMessageQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ public void Enqueue(IActorRef receiver, Envelope envelope)

public bool TryDequeue(out Envelope envelope)
{
if (high.TryDequeue(out envelope)) return true;
if (low.TryDequeue(out envelope))
if (high.TryDequeue(out envelope) || low.TryDequeue(out envelope))
{
if (low.Count == 0 && !(envelope.Message is Idle))
if (Count == 0 && !(envelope.Message is Idle))
low.Enqueue(new Envelope(Idle.Instance, ActorRefs.NoSender));
return true;
}
Expand Down

0 comments on commit 5294a14

Please sign in to comment.