示例#1
0
            // Puts contents of a #splice into NodeQueue and returns the first item of the splice.
            public LNode EnqueueSplice(VList <LNode> spliced, int maxExpansionsInner, int maxExpansions)
            {
                //Debug.Assert(!IsTarget); should be true except that IsTarget may not have been set yet
                MaybeCreateNodeQueue(maxExpansions, ref NodeQueue);

                // Enqueue spliced items
                foreach (var item in spliced.ToFVList())
                {
                    NodeQueue.PushFirst(Pair.Create(item, maxExpansionsInner));
                }

                return(NodeQueue.PopFirst().A);
            }
示例#2
0
        public static VList <LNode> Without(this VList <LNode> list, LNode node)
        {
            int i = list.Count;

            foreach (var item in list.ToFVList())
            {
                i--;
                if (item == node)
                {
                    Debug.Assert(list[i] == node);
                    return(list.RemoveAt(i));
                }
            }
            return(list);
        }