Exemplo n.º 1
0
        public static CachedList <T> Copy(CachedList <T> src)
        {
            CachedList <T>     newList = new CachedList <T>(src.Capacity);
            LinkedListNode <T> srcNode = src.First;

            while (null != srcNode)
            {
                newList.AddLast(srcNode.Value);
                srcNode = srcNode.Next;
            }

            return(newList);
        }
Exemplo n.º 2
0
        public void Poll(CachedList <T> buffer)
        {
            if (null == buffer)
            {
                return;
            }

            var nodeBuff = buffer.First;

            while (null != nodeBuff)
            {
                this.AddLast(nodeBuff.Value);
                nodeBuff = nodeBuff.Next;
            }
            buffer.Clear();
        }
Exemplo n.º 3
0
 public object Clone()
 {
     return(CachedList <T> .Copy(this));
 }