Apache.NMS.ActiveMQ.Util.SimplePriorityMessageDispatchChannel.RemoveFirst C# (CSharp) Method

RemoveFirst() private method

private RemoveFirst ( ) : MessageDispatch
return MessageDispatch
        private MessageDispatch RemoveFirst()
        {
            if(this.size > 0)
            {
                for(int i = MAX_PRIORITY - 1; i >= 0; i--)
                {
                    LinkedList<MessageDispatch> list = channels[i];
                    if(list.Count != 0)
                    {
                        this.size--;
                        MessageDispatch dispatch = list.First.Value;
                        list.RemoveFirst();
                        return dispatch;
                    }
                }
            }
            return null;
        }